jillo-bot/migrations/20231117173052_craftingReci...

28 lines
778 B
JavaScript
Raw Normal View History

2023-11-17 19:23:35 +01:00
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function(knex) {
return knex.schema
2023-11-18 12:59:29 +01:00
.createTable('customCraftingRecipes', (table) => {
2023-11-17 19:23:35 +01:00
table.increments('id');
2023-11-18 12:59:29 +01:00
table.string('station');
2023-11-17 19:23:35 +01:00
})
2023-11-18 12:59:29 +01:00
.createTable('customCraftingRecipeItems', (table) => {
table.integer('id').references('id').inTable('customCraftingRecipes').notNullable();
2023-11-17 19:23:35 +01:00
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
2023-11-18 12:59:29 +01:00
.dropTable('customCraftingRecipes')
.dropTable('customCraftingRecipes');
2023-11-17 19:23:35 +01:00
};