Skip to content
Snippets Groups Projects
Commit c88e2c14 authored by Wilson JALLET's avatar Wilson JALLET :money_with_wings:
Browse files

Rebuilt group Knex schema

parent 5fc3e803
No related branches found
No related tags found
No related merge requests found
exports.up = function (knex, Promise) {
return knex.schema.createTable('groups', function (table) {
table.increments('id').unsigned().primary();
table.dateTime('createdAt').defaultTo(knex.fn.now());
table.dateTime('updatedAt').defaultTo(knex.fn.now());
table.string('name').notNullable();
table.string('uid',128).primary().notNullable();
table.string('website').defaultTo('');
table.text('description').defaultTo('');
table.enum('school', ['polytechnique', 'ensta', 'supoptique']).notNullable();
......
exports.up = function(knex, Promise) {
return knex.schema.table('groups', function(t) {
t.integer('parent');
return knex.schema.table('groups', function(table) {
table.string('parentuid',128);
});
};
exports.down = function(knex, Promise) {
return knex.schema.table('groups', function(t) {
t.dropColumn('parent');
return knex.schema.table('groups', function(table) {
table.dropColumn('parentuid');
});
};
......@@ -6,29 +6,38 @@ exports.seed = function(knex, Promise) {
// Inserts seed entries
const groups = [{
name: 'BR',
uid: 'br',
website: 'br.binets.fr',
description: 'Le Binet Réseau est responsable du réseau internet des élèves sur le campus de l\'Ecole polytechnique.',
school: 'polytechnique'
},
{
school: 'polytechnique',
parentuid: 'kes'
},{
name: 'JTX',
uid: 'jtx',
website: 'binet-jtx.com',
school: 'polytechnique'
},
{
school: 'polytechnique',
parentuid: 'kes'
},{
name: 'Kès',
uid: 'kes',
website: 'kes.binets.fr',
school: 'polytechnique'
},
{
},{
name: 'DaTA',
uid: 'data',
website: 'data-ensta.fr',
school: 'ensta'
},
{
school: 'ensta',
parentuid: 'bdeensta'
},{
name: 'Laser Wave',
uid: 'laserwave',
website: 'laserwave.fr',
school: 'supoptique'
},{
name: 'BDE Ensta',
uid: 'bdeensta',
website: 'http://bde.ensta-paristech.fr/',
school: 'ensta'
}
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment