feat: merge url_api & api_key to App, add application settings page

This commit is contained in:
2026-04-30 11:28:25 +08:00
parent e2ad6f9313
commit 4e9d5964ae
7 changed files with 274 additions and 169 deletions

View File

@@ -0,0 +1,15 @@
-- AlterTable: tambah urlApi dan apiKey ke App
ALTER TABLE "App" ADD COLUMN "urlApi" TEXT;
ALTER TABLE "App" ADD COLUMN "apiKey" TEXT;
-- DataMigration: pindahkan nilai dari app_config ke App sebelum drop
UPDATE "App"
SET "urlApi" = (SELECT value FROM app_config WHERE key = 'URL_API_DESA_PLUS')
WHERE id = 'desa-plus';
UPDATE "App"
SET "apiKey" = (SELECT value FROM app_config WHERE key = 'API_KEY_DESA_PLUS')
WHERE id = 'desa-plus';
-- DropTable
DROP TABLE "app_config";

View File

@@ -0,0 +1 @@
ALTER TABLE "App" ADD COLUMN "active" BOOLEAN NOT NULL DEFAULT true;