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

fix dropped column

parent 753d05b9
No related branches found
No related tags found
No related merge requests found
exports.up = async function(knex, Promise) {
await knex.schema.dropTable('posts');
await knex.schema.table('messages', function(table){
table.dropColumn('authors');
});
await knex.schema.createTable('private_post', function(table){
table.inherits('messages');
table.string('author_uid', 128).notNullable();
table.enum('author_db', ['ldap']).notNullable().defaultTo('ldap');
table.string('recipient_uid', 128).notNullable();
});
await knex.schema.createTable('question', function(table){
table.inherits('messages');
table.string('author_uid', 128).notNullable();
table.enum('author_db', ['ldap']).notNullable().defaultTo('ldap');
table.string('recipient_uid', 128).notNullable();
});
await knex.schema.createTable('answer', function(table){
table.inherits('messages');
table.string('author_uid', 128).notNullable();
table.string('recipient_uid', 128).notNullable();
table.string('for_question', 128).notNullable();
});
return;
await knex.schema.dropTable('posts');
await knex.schema.table('messages', function(table){
table.dropColumn('authors');
});
await knex.schema.createTable('private_post', function(table){
table.inherits('messages');
table.string('author_uid', 128).notNullable();
table.enum('author_db', ['ldap']).notNullable().defaultTo('ldap');
table.string('recipient_uid', 128).notNullable();
});
await knex.schema.createTable('question', function(table){
table.inherits('messages');
table.string('author_uid', 128).notNullable();
table.enum('author_db', ['ldap']).notNullable().defaultTo('ldap');
table.string('recipient_uid', 128).notNullable();
});
await knex.schema.createTable('answer', function(table){
table.inherits('messages');
table.string('author_uid', 128).notNullable();
table.string('recipient_uid', 128).notNullable();
table.string('for_question', 128).notNullable();
});
await knex.schema.table('events', function(table){
table.specificType('authors', knex.raw('varchar(128)[]'));
});
await knex.schema.table('announcements', function(table){
table.specificType('authors', knex.raw('varchar(128)[]'));
});
return;
};
exports.down = async function(knex, Promise) {
......
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