Lambda-School-Labs/Labs26-StorySquad-BE-TeamB

View on GitHub
data/migrations/20201007143802_cohorts.js

Summary

Maintainability
A
0 mins
Test Coverage
exports.up = function (knex) {
  return knex.schema.createTable('Cohorts', (t) => {
    t.increments('ID');
    t.integer('StoryID')
      .notNullable()
      .unsigned()
      .references('Stories.ID')
      .onUpdate('CASCADE')
      .onDelete('RESTRICT');
  });
};

exports.down = function (knex) {
  return knex.schema.dropTableIfExists('Cohorts');
};