chore: Remove updatedAt column from events table (#3841)
This commit is contained in:
14
server/migrations/20220722184916-remove-event-updatedat.js
Normal file
14
server/migrations/20220722184916-remove-event-updatedat.js
Normal 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'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -20,7 +20,7 @@ import User from "./User";
|
|||||||
import IdModel from "./base/IdModel";
|
import IdModel from "./base/IdModel";
|
||||||
import Fix from "./decorators/Fix";
|
import Fix from "./decorators/Fix";
|
||||||
|
|
||||||
@Table({ tableName: "events", modelName: "event" })
|
@Table({ tableName: "events", modelName: "event", updatedAt: false })
|
||||||
@Fix
|
@Fix
|
||||||
class Event extends IdModel {
|
class Event extends IdModel {
|
||||||
@IsUUID(4)
|
@IsUUID(4)
|
||||||
@@ -106,7 +106,6 @@ class Event extends IdModel {
|
|||||||
globalEventQueue.add(
|
globalEventQueue.add(
|
||||||
this.build({
|
this.build({
|
||||||
createdAt: now,
|
createdAt: now,
|
||||||
updatedAt: now,
|
|
||||||
...event,
|
...event,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user