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:
parent
c3273ce1ab
commit
00f5740d18
@ -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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -5,7 +5,7 @@ export interface IProjectInsert {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
lastUpdate?: Date;
|
||||
updatedAt?: Date;
|
||||
}
|
||||
|
||||
export interface IProjectArchived {
|
||||
|
@ -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);
|
||||
};
|
12
src/migrations/20211130142314-add-updated-at-to-projects.js
Normal file
12
src/migrations/20211130142314-add-updated-at-to-projects.js
Normal 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);
|
||||
};
|
Loading…
Reference in New Issue
Block a user