feat: merge url_api & api_key to App, add application settings page
This commit is contained in:
@@ -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";
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE "App" ADD COLUMN "active" BOOLEAN NOT NULL DEFAULT true;
|
||||
@@ -72,16 +72,18 @@ model Session {
|
||||
}
|
||||
|
||||
model App {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
version String?
|
||||
minVersion String?
|
||||
maintenance Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
version String?
|
||||
minVersion String?
|
||||
maintenance Boolean @default(false)
|
||||
active Boolean @default(true)
|
||||
urlApi String?
|
||||
apiKey String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
bugs Bug[]
|
||||
|
||||
}
|
||||
|
||||
model Log {
|
||||
@@ -146,14 +148,6 @@ model BugLog {
|
||||
@@map("bug_log")
|
||||
}
|
||||
|
||||
model AppConfig {
|
||||
key String @id
|
||||
value String
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@map("app_config")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user