gancio/server/migrations/20250220213026-page.js
2025-02-21 08:19:14 +01:00

38 lines
805 B
JavaScript

'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
return queryInterface.createTable('pages', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
title: Sequelize.STRING,
content: {
type: Sequelize.STRING
},
visible: Sequelize.BOOLEAN,
slug: {
type: Sequelize.STRING,
index: true,
unique: true
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
})
},
async down (queryInterface, Sequelize) {
return queryInterface.dropTable('pages')
}
};