UNPKG

@tomei/live-price

Version:

Tomei live-price Package

33 lines (30 loc) 899 B
'use strict'; /** @type {import('sequelize-cli').Migration} */ module.exports = { up: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { const tableDescription = await queryInterface.describeTable('price_Feed'); // Only add Weight column if it doesn't exist if (!tableDescription.Weight) { await queryInterface.addColumn( 'price_Feed', 'Weight', { type: Sequelize.DECIMAL(10, 2), allowNull: true, }, { transaction } ); } }); }, down: async (queryInterface, Sequelize) => { await queryInterface.sequelize.transaction(async (transaction) => { await queryInterface.removeColumn( 'price_Feed', 'Weight', { transaction } ); }); }, };