| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 'use strict'
- module.exports = {
- /**
- * @param {Types} Sequelize
- */
- up: (queryInterface, Sequelize) => {
- return queryInterface.createTable('equipments', {
- id: {
- primaryKey: true,
- autoIncrement: true,
- type: Sequelize.BIGINT.UNSIGNED
- },
- name: {
- allowNull: false,
- type: Sequelize.STRING(30)
- },
- current_user_id: {
- type: Sequelize.BIGINT.UNSIGNED,
- references: {
- model: {
- tableName: 'users'
- },
- key: 'id'
- }
- }
- })
- /*
- Add altering commands here.
- Return a promise to correctly handle asynchronicity.
- Example:
- return queryInterface.createTable('users', { id: Sequelize.INTEGER });
- */
- },
- down: (queryInterface, Sequelize) => {
- return queryInterface.dropTable('equipments')
- /*
- Add reverting commands here.
- Return a promise to correctly handle asynchronicity.
- Example:
- return queryInterface.dropTable('users');
- */
- }
- }
|