Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define our notes table migration
- module.exports = {
- up: (queryInterface, Sequelize) => {
- return queryInterface.createTable(‘notes’, {
- id: {
- type: Sequelize.INTEGER,
- primaryKey: true,
- autoIncrement: true,
- },
- title: {
- type: Sequelize.TEXT,
- },
- body: {
- type: Sequelize.TEXT,
- },
- userId: {
- type: Sequelize.INTEGER,
- references: {
- model: ‘users’,
- key: ‘id’,
- },
- },
- createdAt: {
- type: Sequelize.DATE,
- },
- updatedAt: {
- type: Sequelize.DATE,
- },
- });
- },
- down: (queryInterface) => {
- return queryInterface.dropTable(‘notes’);
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement