homepage.js/migrations/20230222114001-create-artic...

18 lines
539 B
JavaScript
Raw Normal View History

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) {
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');
}
}
};