Skip to content
Snippets Groups Projects
Forked from an inaccessible project.
20190310155843_create_events_participating_users.js 595 B

exports.up = function(knex, Promise) {
    return knex.schema.createTable('events_participating_users', function (table) {
        table.increments('id'); //autoincrementing (non-nullable) primary key

        table.integer('mid').notNullable()
            .references('mid').inTable('messages_events')
            .onDelete('CASCADE'); //if event is deleted, also delete from participating_groups

        table.string('uid', 128).notNullable(); // Must refer to a user id
    });
};

exports.down = function(knex, Promise) {
    return knex.schema.dropTable('events_participating_users');
};