32 lines
891 B
TypeScript
32 lines
891 B
TypeScript
import { BaseMigration } from './base-migration.ts';
|
|
import type { TQueryFunction } from '../types.ts';
|
|
|
|
export class Migration015SmartProxyPlatformService extends BaseMigration {
|
|
readonly version = 15;
|
|
readonly description = 'Rename Caddy platform service to SmartProxy';
|
|
|
|
up(query: TQueryFunction): void {
|
|
query(
|
|
`UPDATE platform_services
|
|
SET name = 'onebox-smartproxy',
|
|
type = 'smartproxy',
|
|
container_id = CASE
|
|
WHEN container_id = 'onebox-caddy' THEN 'onebox-smartproxy'
|
|
ELSE container_id
|
|
END,
|
|
config = ?,
|
|
updated_at = ?
|
|
WHERE type = 'caddy'`,
|
|
[
|
|
JSON.stringify({
|
|
image: 'code.foss.global/host.today/ht-docker-smartproxy:latest',
|
|
port: 80,
|
|
volumes: [],
|
|
environment: {},
|
|
}),
|
|
Date.now(),
|
|
],
|
|
);
|
|
}
|
|
}
|