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:
Meier Lukas
2024-10-07 21:13:38 +02:00
committed by GitHub
parent eb21628ee4
commit ab1744ce20
15 changed files with 3094 additions and 1 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE `user` ADD `firstDayOfWeek` tinyint DEFAULT 1 NOT NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -71,6 +71,13 @@
"when": 1728074730696,
"tag": "0009_wakeful_tenebrous",
"breakpoints": true
},
{
"idx": 10,
"version": "5",
"when": 1728142597094,
"tag": "0010_melted_pestilence",
"breakpoints": true
}
]
}

View File

@@ -0,0 +1 @@
ALTER TABLE `user` ADD `firstDayOfWeek` integer DEFAULT 1 NOT NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -71,6 +71,13 @@
"when": 1728074724956,
"tag": "0009_stale_roulette",
"breakpoints": true
},
{
"idx": 10,
"version": "6",
"when": 1728142590232,
"tag": "0010_gorgeous_stingray",
"breakpoints": true
}
]
}

View File

@@ -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(

View File

@@ -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(