2023-02-22 14:55:17 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
|
|
module.exports = {
|
|
|
|
/** @param {import('sequelize').QueryInterface} queryInterface */
|
|
|
|
async up (queryInterface, DataTypes) {
|
2023-02-22 15:21:29 +01:00
|
|
|
const struct = require('../models').Article.structure;
|
|
|
|
queryInterface.createTable('articles', struct);
|
2023-02-22 14:55:17 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
/** @param {import('sequelize').QueryInterface} queryInterface */
|
|
|
|
async down (queryInterface, DataTypes) {
|
|
|
|
if (await queryInterface.tableExists('articles')) {
|
|
|
|
await queryInterface.dropTable('articles');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|