jillo-bot/migrations/20231117173052_craftingReci...

28 lines
778 B
JavaScript

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function(knex) {
return knex.schema
.createTable('customCraftingRecipes', (table) => {
table.increments('id');
table.string('station');
})
.createTable('customCraftingRecipeItems', (table) => {
table.integer('id').references('id').inTable('customCraftingRecipes').notNullable();
table.integer('item').notNullable();
table.integer('quantity').defaultTo(1);
table.enum('type', ['input', 'output', 'requirement']);
});
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function(knex) {
return knex.schema
.dropTable('customCraftingRecipes')
.dropTable('customCraftingRecipes');
};