exports.up = function (knex, Promise) { return knex.schema.createTable('groups', function (table) { table.timestamp(true, true); table.string('name').notNullable(); table.string('uid',128).primary().notNullable(); table.string('parent_uid',128); table.foreign('parent_uid').references('groups.uid'); table.string('website').defaultTo(''); table.text('description').defaultTo(''); table.enum('school', ['polytechnique', 'ensta', 'supoptique']).notNullable(); }); }; exports.down = function (knex, Promise) { return knex.schema.dropTable('groups'); };