Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- module.exports = {
- up: (queryInterface, Sequelize) => {
- return queryInterface.createTable('Orders', {
- id: {
- type: Sequelize.CHAR
- },
- storeId: {
- type: Sequelize.INTEGER,
- references: {
- model: 'Stores',
- key: 'id'
- }
- },
- createdAt: {
- allowNull: false,
- type: Sequelize.DATE
- },
- updatedAt: {
- allowNull: false,
- type: Sequelize.DATE
- }
- });
- },
- down: (queryInterface, Sequelize) => {
- return queryInterface.dropTable('Orders');
- }
- };
- 'use strict';
- module.exports = {
- up: (queryInterface, Sequelize) => {
- return queryInterface.createTable('Stores', {
- id: {
- allowNull: false,
- autoIncrement: true,
- primaryKey: true,
- type: Sequelize.INTEGER
- },
- login: {
- type: Sequelize.CHAR
- },
- uuid: {
- type: Sequelize.CHAR
- },
- createdAt: {
- allowNull: false,
- type: Sequelize.DATE
- },
- updatedAt: {
- allowNull: false,
- type: Sequelize.DATE
- }
- });
- },
- down: (queryInterface, Sequelize) => {
- return queryInterface.dropTable('Stores');
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement