feat: add first day of week user setting (#1249)
* feat: add first day of week user setting * fix: add missing migrations * fix: format and test issues * fix: deepsource issue * refactor: rename first-day-of-week procedure
This commit is contained in:
1
packages/db/migrations/mysql/0010_melted_pestilence.sql
Normal file
1
packages/db/migrations/mysql/0010_melted_pestilence.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `user` ADD `firstDayOfWeek` tinyint DEFAULT 1 NOT NULL;
|
||||
1489
packages/db/migrations/mysql/meta/0010_snapshot.json
Normal file
1489
packages/db/migrations/mysql/meta/0010_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -71,6 +71,13 @@
|
||||
"when": 1728074730696,
|
||||
"tag": "0009_wakeful_tenebrous",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 10,
|
||||
"version": "5",
|
||||
"when": 1728142597094,
|
||||
"tag": "0010_melted_pestilence",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
1
packages/db/migrations/sqlite/0010_gorgeous_stingray.sql
Normal file
1
packages/db/migrations/sqlite/0010_gorgeous_stingray.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `user` ADD `firstDayOfWeek` integer DEFAULT 1 NOT NULL;
|
||||
1422
packages/db/migrations/sqlite/meta/0010_snapshot.json
Normal file
1422
packages/db/migrations/sqlite/meta/0010_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -71,6 +71,13 @@
|
||||
"when": 1728074724956,
|
||||
"tag": "0009_stale_roulette",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 10,
|
||||
"version": "6",
|
||||
"when": 1728142590232,
|
||||
"tag": "0010_gorgeous_stingray",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { AdapterAccount } from "@auth/core/adapters";
|
||||
import type { DayOfWeek } from "@mantine/dates";
|
||||
import { relations } from "drizzle-orm";
|
||||
import type { AnyMySqlColumn } from "drizzle-orm/mysql-core";
|
||||
import { boolean, index, int, mysqlTable, primaryKey, text, timestamp, varchar } from "drizzle-orm/mysql-core";
|
||||
import { boolean, index, int, mysqlTable, primaryKey, text, timestamp, tinyint, varchar } from "drizzle-orm/mysql-core";
|
||||
|
||||
import type {
|
||||
BackgroundImageAttachment,
|
||||
@@ -43,6 +44,7 @@ export const users = mysqlTable("user", {
|
||||
onDelete: "set null",
|
||||
}),
|
||||
colorScheme: varchar("colorScheme", { length: 5 }).$type<ColorScheme>().default("auto").notNull(),
|
||||
firstDayOfWeek: tinyint("firstDayOfWeek").$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
||||
});
|
||||
|
||||
export const accounts = mysqlTable(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { AdapterAccount } from "@auth/core/adapters";
|
||||
import type { DayOfWeek } from "@mantine/dates";
|
||||
import type { InferSelectModel } from "drizzle-orm";
|
||||
import { relations } from "drizzle-orm";
|
||||
import type { AnySQLiteColumn } from "drizzle-orm/sqlite-core";
|
||||
@@ -44,6 +45,7 @@ export const users = sqliteTable("user", {
|
||||
onDelete: "set null",
|
||||
}),
|
||||
colorScheme: text("colorScheme").$type<ColorScheme>().default("auto").notNull(),
|
||||
firstDayOfWeek: int("firstDayOfWeek").$type<DayOfWeek>().default(1).notNull(), // Defaults to Monday
|
||||
});
|
||||
|
||||
export const accounts = sqliteTable(
|
||||
|
||||
Reference in New Issue
Block a user