Skip to content

Commit 1d4b043

Browse files
committed
feat: refactor global settings structure to use groups instead of categories, update related schemas and routes
1 parent 5cd79cf commit 1d4b043

File tree

13 files changed

+1174
-381
lines changed

13 files changed

+1174
-381
lines changed

services/backend/GLOBAL_SETTINGS.md

Lines changed: 276 additions & 325 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
CREATE TABLE `globalSettingGroups` (
2+
`id` text PRIMARY KEY NOT NULL,
3+
`name` text NOT NULL,
4+
`description` text,
5+
`icon` text,
6+
`sort_order` integer DEFAULT 0 NOT NULL,
7+
`created_at` integer NOT NULL,
8+
`updated_at` integer NOT NULL
9+
);
10+
--> statement-breakpoint
11+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
12+
CREATE TABLE `__new_globalSettings` (
13+
`key` text PRIMARY KEY NOT NULL,
14+
`value` text NOT NULL,
15+
`description` text,
16+
`is_encrypted` integer DEFAULT false NOT NULL,
17+
`group_id` text,
18+
`created_at` integer NOT NULL,
19+
`updated_at` integer NOT NULL,
20+
FOREIGN KEY (`group_id`) REFERENCES `globalSettingGroups`(`id`) ON UPDATE no action ON DELETE no action
21+
);
22+
--> statement-breakpoint
23+
INSERT INTO `__new_globalSettings`("key", "value", "description", "is_encrypted", "group_id", "created_at", "updated_at") SELECT "key", "value", "description", "is_encrypted", "category", "created_at", "updated_at" FROM `globalSettings`;--> statement-breakpoint
24+
DROP TABLE `globalSettings`;--> statement-breakpoint
25+
ALTER TABLE `__new_globalSettings` RENAME TO `globalSettings`;--> statement-breakpoint
26+
PRAGMA foreign_keys=ON;

0 commit comments

Comments
 (0)