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',
|
'description',
|
||||||
'created_at',
|
'created_at',
|
||||||
'health',
|
'health',
|
||||||
'last_update',
|
'updated_at',
|
||||||
];
|
];
|
||||||
const TABLE = 'projects';
|
const TABLE = 'projects';
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ class ProjectStore implements IProjectStore {
|
|||||||
async updateHealth(healthUpdate: IProjectHealthUpdate): Promise<void> {
|
async updateHealth(healthUpdate: IProjectHealthUpdate): Promise<void> {
|
||||||
await this.db(TABLE)
|
await this.db(TABLE)
|
||||||
.where({ id: healthUpdate.id })
|
.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> {
|
async create(project: IProjectInsert): Promise<IProject> {
|
||||||
@ -204,7 +204,7 @@ class ProjectStore implements IProjectStore {
|
|||||||
description: row.description,
|
description: row.description,
|
||||||
createdAt: row.created_at,
|
createdAt: row.created_at,
|
||||||
health: row.health || 100,
|
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,
|
name: project.name,
|
||||||
description: project.description,
|
description: project.description,
|
||||||
health: project.health,
|
health: project.health,
|
||||||
lastUpdate: project.lastUpdate,
|
updatedAt: project.updatedAt,
|
||||||
environments,
|
environments,
|
||||||
features,
|
features,
|
||||||
members,
|
members,
|
||||||
|
@ -143,7 +143,7 @@ export interface IProjectOverview {
|
|||||||
members: number;
|
members: number;
|
||||||
version: number;
|
version: number;
|
||||||
health: number;
|
health: number;
|
||||||
lastUpdate?: Date;
|
updatedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProjectHealthReport extends IProjectOverview {
|
export interface IProjectHealthReport extends IProjectOverview {
|
||||||
@ -310,7 +310,7 @@ export interface IProject {
|
|||||||
description: string;
|
description: string;
|
||||||
health?: number;
|
health?: number;
|
||||||
createdAt?: Date;
|
createdAt?: Date;
|
||||||
lastUpdate?: Date;
|
updatedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProjectWithCount extends IProject {
|
export interface IProjectWithCount extends IProject {
|
||||||
|
@ -5,7 +5,7 @@ export interface IProjectInsert {
|
|||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
lastUpdate?: Date;
|
updatedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProjectArchived {
|
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