| 1234567891011121314151617181920212223242526272829303132333435 |
- 'use strict'
- module.exports = {
- up: async (queryInterface, Sequelize) => {
- await queryInterface.addColumn('equipments', 'site_id', {
- type: Sequelize.BIGINT.UNSIGNED,
- allowNull: false
- })
- await queryInterface.addConstraint('equipments', ['site_id'], {
- type: 'foreign key',
- references: {
- table: 'sites',
- field: 'id'
- }
- })
- /*
- Add altering commands here.
- Return a promise to correctly handle asynchronicity.
- Example:
- return queryInterface.createTable('users', { id: Sequelize.INTEGER });
- */
- },
- down: (queryInterface, Sequelize) => {
- /*
- Add reverting commands here.
- Return a promise to correctly handle asynchronicity.
- Example:
- return queryInterface.dropTable('users');
- */
- }
- }
|