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 13:24:56 +01:00
|
|
|
table.string('guild');
|
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')
|
2023-11-18 13:24:56 +01:00
|
|
|
.dropTable('customCraftingRecipeItems');
|
2023-11-17 19:23:35 +01:00
|
|
|
};
|