mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 07:36:37 +08:00
refactor(db): use version string as primary key for ConfigVersion
-transition `of_config_versions` primary key from `id` to `version` string. -add database migration files `202606270001_make_version_primary_key.sql` for PostgreSQL and SQLite. -introduce AfterFind/AfterCreate GORM hooks to preserve JSON backward compatibility. -refactor API controllers, logics, and front-end typescript definitions to receive `string` parameter.
This commit is contained in:
@@ -29,7 +29,7 @@ export class ConfigVersionService extends OpenFlareBaseService {
|
||||
return this.get<ConfigDiffResult>('/diff');
|
||||
}
|
||||
|
||||
static getById(id: number): Promise<ConfigVersionDetail> {
|
||||
static getById(id: string): Promise<ConfigVersionDetail> {
|
||||
return this.get<ConfigVersionDetail>(`/${id}`);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export class ConfigVersionService extends OpenFlareBaseService {
|
||||
);
|
||||
}
|
||||
|
||||
static activate(id: number): Promise<ConfigVersionDetail> {
|
||||
static activate(id: string): Promise<ConfigVersionDetail> {
|
||||
return this.post<ConfigVersionDetail>(`/${id}/activate`);
|
||||
}
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ export interface ProxyRouteMutationPayload {
|
||||
}
|
||||
|
||||
export interface ConfigVersionSummary {
|
||||
id: number;
|
||||
id: string;
|
||||
version: string;
|
||||
checksum: string;
|
||||
is_active: boolean;
|
||||
|
||||
Reference in New Issue
Block a user