1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: rename last_update to updated_at

This commit is contained in:
Youssef 2021-11-30 15:25:52 +01:00
parent c3273ce1ab
commit 00f5740d18
6 changed files with 19 additions and 19 deletions

View File

@ -17,7 +17,7 @@ const COLUMNS = [
'description',
'created_at',
'health',
'last_update',
'updated_at',
];
const TABLE = 'projects';
@ -81,7 +81,7 @@ class ProjectStore implements IProjectStore {
async updateHealth(healthUpdate: IProjectHealthUpdate): Promise<void> {
await this.db(TABLE)
.where({ id: healthUpdate.id })
.update({ health: healthUpdate.health, last_update: new Date() });
.update({ health: healthUpdate.health, updated_at: new Date() });
}
async create(project: IProjectInsert): Promise<IProject> {
@ -204,7 +204,7 @@ class ProjectStore implements IProjectStore {
description: row.description,
createdAt: row.created_at,
health: row.health || 100,
lastUpdate: row.last_update || new Date(),
updatedAt: row.updated_at || new Date(),
};
}
}

View File

@ -72,7 +72,7 @@ export default class ProjectHealthService {
name: project.name,
description: project.description,
health: project.health,
lastUpdate: project.lastUpdate,
updatedAt: project.updatedAt,
environments,
features,
members,

View File

@ -143,7 +143,7 @@ export interface IProjectOverview {
members: number;
version: number;
health: number;
lastUpdate?: Date;
updatedAt?: Date;
}
export interface IProjectHealthReport extends IProjectOverview {
@ -310,7 +310,7 @@ export interface IProject {
description: string;
health?: number;
createdAt?: Date;
lastUpdate?: Date;
updatedAt?: Date;
}
export interface IProjectWithCount extends IProject {

View File

@ -5,7 +5,7 @@ export interface IProjectInsert {
id: string;
name: string;
description: string;
lastUpdate?: Date;
updatedAt?: Date;
}
export interface IProjectArchived {

View File

@ -1,12 +0,0 @@
'use strict';
exports.up = function (db, callback) {
db.runSql(
'ALTER TABLE projects ADD COLUMN "last_update" TIMESTAMP WITH TIME ZONE',
callback,
);
};
exports.down = function (db, callback) {
db.runSql('ALTER TABLE projects DROP COLUMN "last_update";', callback);
};

View File

@ -0,0 +1,12 @@
'use strict';
exports.up = function (db, callback) {
db.runSql(
'ALTER TABLE projects ADD COLUMN "updated_at" TIMESTAMP WITH TIME ZONE',
callback,
);
};
exports.down = function (db, callback) {
db.runSql('ALTER TABLE projects DROP COLUMN "updated_at";', callback);
};