diff --git a/db/migrations/20180304154225_group_type_column.js b/db/migrations/20180304154225_group_type_column.js new file mode 100644 index 0000000000000000000000000000000000000000..61f2aaa6967712521a774cc1a052df6e3f21055d --- /dev/null +++ b/db/migrations/20180304154225_group_type_column.js @@ -0,0 +1,17 @@ + +exports.up = function(knex, Promise) { + return knex.schema.table('groups', function(table) { + table.enum('type', ['simple', 'meta', 'error']).notNullable().defaultTo('error'); + }).then( () => { + return knex('simple_groups').update({type : "simple"}).then(() => { + return knex('meta_groups').update({type : "meta"}); + }); + }); + +}; + +exports.down = function(knex, Promise) { + return knex.schema.table('groups', function(table) { + table.dropColumn('type'); + }); +}; diff --git a/db/seeds/01_create_groups.js b/db/seeds/01_create_groups.js index 35948da68c3b186d871dc6907ee20a0de4a2d55b..26b10129f074056df5fc0063ed2c92c1489ff176 100644 --- a/db/seeds/01_create_groups.js +++ b/db/seeds/01_create_groups.js @@ -12,34 +12,40 @@ exports.seed = function(knex, Promise) { 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', - parentuid: 'kes' + parentuid: 'kes', + type : 'simple' },{ name: 'JTX', uid: 'jtx', website: 'binet-jtx.com', school: 'polytechnique', - parentuid: 'kes' + parentuid: 'kes', + type : 'simple' },{ name: 'Kès', uid: 'kes', website: 'kes.binets.fr', - school: 'polytechnique' + school: 'polytechnique', + type : 'simple' },{ name: 'DaTA', uid: 'data', website: 'data-ensta.fr', school: 'ensta', - parentuid: 'bdeensta' + parentuid: 'bdeensta', + type : 'simple' },{ name: 'Laser Wave', uid: 'laserwave', website: 'laserwave.fr', - school: 'supoptique' + school: 'supoptique', + type : 'simple' },{ name: 'BDE Ensta', uid: 'bdeensta', website: 'http://bde.ensta-paristech.fr/', - school: 'ensta' + school: 'ensta', + type : 'simple' } ]; diff --git a/db/seeds/04_make_metagroups.js b/db/seeds/04_make_metagroups.js index be6fbeade3cfdf1460ee312adcaf02001180699d..432bb33d1b96b6f4fda099d16cbf35d471193c6a 100644 --- a/db/seeds/04_make_metagroups.js +++ b/db/seeds/04_make_metagroups.js @@ -9,12 +9,14 @@ exports.seed = function(knex, Promise) { name: 'Fédérez', uid: 'federez', website: 'federez.io', - description: "L'association de toutes les associations de réseau des écoles" + description: "L'association de toutes les associations de réseau des écoles", + type : 'meta' }, { name: 'BSCkBl', uid: 'bsckbl', - website: 'bsckbl.binets.fr' + website: 'bsckbl.binets.fr', + type : 'meta' } ]); });