22 lines
499 B
JavaScript
22 lines
499 B
JavaScript
![]() |
/**
|
||
|
* @param { import("knex").Knex } knex
|
||
|
* @returns { Promise<void> }
|
||
|
*/
|
||
|
exports.up = function (knex) {
|
||
|
return knex.schema.createTable('recipes', function (table) {
|
||
|
table.increments('id').primary();
|
||
|
table.string('name').notNullable().unique();
|
||
|
table.string('cuisine').notNullable();
|
||
|
table.timestamps(true, true);
|
||
|
})
|
||
|
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* @param { import("knex").Knex } knex
|
||
|
* @returns { Promise<void> }
|
||
|
*/
|
||
|
exports.down = function (knex) {
|
||
|
return knex.schema.dropTable('users');
|
||
|
};
|