const TABLE_NAME = 'users';

exports.up = function(knex, Promise) {

  return Promise.all([
    knex.schema.table(TABLE_NAME, function (table) {
      table.dropColumn('login');
      table.boolean('cgu');
    })
  ]);

};

exports.down = function(knex, Promise) {
  return Promise.all([
    knex.schema.table(TABLE_NAME, function (table) {
      table.string('login').defaultTo("").notNullable();
      table.dropColumn('cgu');
    })
  ]);
};

const TABLE_NAME = 'users';

exports.up = function(knex, Promise) {

  return Promise.all([
    knex.schema.table(TABLE_NAME, function (table) {
      table.dropColumn('login');
      table.boolean('cgu');
      table.unique('email');
    })
  ]);

};

exports.down = function(knex, Promise) {
  return Promise.all([
    knex.schema.table(TABLE_NAME, function (table) {
      table.string('login').defaultTo("").notNullable();
      table.dropColumn('cgu');
    })
  ]);
};

Revert "FIX - Removing unique constraint on user.email from migration script"
Revert "FIX - Removing unique constraint on user.email from migration script"

This reverts commit c6cedc7fa613c9f376b5d59938acdaad1e4eae7f.
