feat: add server settings (#487)
* feat: add server settings * feat: remove old migration * feat: add new migrations * refactor: format * fix: build error * refactor: format * fix: lint
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE `serverSetting` (
|
||||
`key` varchar(64) NOT NULL,
|
||||
`value` text NOT NULL DEFAULT ('{"json": {}}'),
|
||||
CONSTRAINT `serverSetting_key` PRIMARY KEY(`key`),
|
||||
CONSTRAINT `serverSetting_key_unique` UNIQUE(`key`)
|
||||
);
|
||||
1200
packages/db/migrations/mysql/meta/0002_snapshot.json
Normal file
1200
packages/db/migrations/mysql/meta/0002_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,13 @@
|
||||
"when": 1715885855801,
|
||||
"tag": "0001_wild_alex_wilder",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "5",
|
||||
"when": 1716148439439,
|
||||
"tag": "0002_freezing_black_panther",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
packages/db/migrations/sqlite/0002_adorable_raider.sql
Normal file
6
packages/db/migrations/sqlite/0002_adorable_raider.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE `serverSetting` (
|
||||
`key` text PRIMARY KEY NOT NULL,
|
||||
`value` text DEFAULT '{"json": {}}' NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `serverSetting_key_unique` ON `serverSetting` (`key`);
|
||||
1144
packages/db/migrations/sqlite/meta/0002_snapshot.json
Normal file
1144
packages/db/migrations/sqlite/meta/0002_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,13 @@
|
||||
"when": 1715871797713,
|
||||
"tag": "0001_mixed_titanium_man",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "6",
|
||||
"when": 1716148434186,
|
||||
"tag": "0002_adorable_raider",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -311,6 +311,11 @@ export const iconRepositories = mysqlTable("iconRepository", {
|
||||
slug: varchar("iconRepository_slug", { length: 150 }).notNull(),
|
||||
});
|
||||
|
||||
export const serverSettings = mysqlTable("serverSetting", {
|
||||
settingKey: varchar("key", { length: 64 }).notNull().unique().primaryKey(),
|
||||
value: text("value").default('{"json": {}}').notNull(), // empty superjson object
|
||||
});
|
||||
|
||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||
user: one(users, {
|
||||
fields: [accounts.userId],
|
||||
|
||||
@@ -304,6 +304,11 @@ export const iconRepositories = sqliteTable("iconRepository", {
|
||||
slug: text("iconRepository_slug").notNull(),
|
||||
});
|
||||
|
||||
export const serverSettings = sqliteTable("serverSetting", {
|
||||
settingKey: text("key").notNull().unique().primaryKey(),
|
||||
value: text("value").default('{"json": {}}').notNull(), // empty superjson object
|
||||
});
|
||||
|
||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||
user: one(users, {
|
||||
fields: [accounts.userId],
|
||||
|
||||
Reference in New Issue
Block a user