chore: Remove updatedAt column from events table (#3841)

This commit is contained in:
Apoorv Mishra
2022-07-24 14:27:21 +05:30
committed by GitHub
parent 7ae892fe06
commit 24170e8684
2 changed files with 15 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
'use strict';
module.exports = {
async up (queryInterface, Sequelize) {
await queryInterface.removeColumn("events", "updatedAt");
},
async down (queryInterface, Sequelize) {
await queryInterface.addColumn("events", "updatedAt", {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.fn('NOW'),
});
}
};

View File

@@ -20,7 +20,7 @@ import User from "./User";
import IdModel from "./base/IdModel";
import Fix from "./decorators/Fix";
@Table({ tableName: "events", modelName: "event" })
@Table({ tableName: "events", modelName: "event", updatedAt: false })
@Fix
class Event extends IdModel {
@IsUUID(4)
@@ -106,7 +106,6 @@ class Event extends IdModel {
globalEventQueue.add(
this.build({
createdAt: now,
updatedAt: now,
...event,
})
);