0380-cleanup-timestamps.ts 689 B

1234567891011121314151617181920212223242526272829
  1. import * as Sequelize from 'sequelize'
  2. async function up (utils: {
  3. transaction: Sequelize.Transaction,
  4. queryInterface: Sequelize.QueryInterface,
  5. sequelize: Sequelize.Sequelize,
  6. db: any
  7. }): Promise<void> {
  8. try {
  9. await utils.queryInterface.removeColumn('application', 'createdAt')
  10. } catch { /* the column could not exist */ }
  11. try {
  12. await utils.queryInterface.removeColumn('application', 'updatedAt')
  13. } catch { /* the column could not exist */ }
  14. try {
  15. await utils.queryInterface.removeColumn('videoView', 'updatedAt')
  16. } catch { /* the column could not exist */ }
  17. }
  18. function down (options) {
  19. throw new Error('Not implemented.')
  20. }
  21. export {
  22. up,
  23. down
  24. }