recipe author and stars and a bit of cleanup

This commit is contained in:
fred 2025-07-24 12:11:32 -07:00
parent c47dac9986
commit 6f43d17ddd
21 changed files with 361 additions and 207 deletions

View file

@ -0,0 +1,24 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.table('recipe_ingredients', table => {
table.string('raw', 255).defaultTo('');
table.integer('ingredient_id').nullable().alter();
table.string('quantity').nullable().alter();
table.string('unit').nullable().alter();
}).table('recipe_steps', table => {
table.string('instruction', 510).alter();
});
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.table('recipe_ingredients', table => {
table.dropColumn('raw');
});
};

View file

@ -0,0 +1,22 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.table('recipes', table => {
table.string('author');
table.integer('stars');
})
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.table('recipes', table => {
table.dropColumn('author');
table.dropColumn('stars')
})
};