mirror of
https://git.moonleay.net/Websites/liljudd-website.git
synced 2025-07-26 11:22:04 +02:00
Fix: Using bigint and added backend testing
This commit is contained in:
parent
ed6195e1e2
commit
89507f8412
20 changed files with 830 additions and 292 deletions
|
@ -1,7 +1,7 @@
|
|||
import { relations } from "drizzle-orm";
|
||||
import {
|
||||
bigint,
|
||||
boolean,
|
||||
integer,
|
||||
pgTable,
|
||||
primaryKey,
|
||||
serial,
|
||||
|
@ -39,14 +39,16 @@ export const discordTokens = pgTable("tokens", {
|
|||
});
|
||||
|
||||
export const guilds = pgTable("guilds", {
|
||||
id: integer("id").primaryKey(),
|
||||
id: bigint("id", { mode: "bigint" }).primaryKey(),
|
||||
timezone: text("timezone").notNull().default("Etc/UTC"),
|
||||
tpEnabled: boolean("tp_enabled").notNull().default(false),
|
||||
tpChannelId: integer("tp_channel_id"),
|
||||
tpInterval: smallint("target_interval").notNull(),
|
||||
tpRoles: boolean("tp_roles").notNull(),
|
||||
isAvailableRoleId: integer("is_available_role_id"),
|
||||
wantsToBeNotifieRoledId: integer("wants_to_be_notified_role_id"),
|
||||
tpChannelId: bigint("tp_channel_id", { mode: "bigint" }),
|
||||
tpInterval: smallint("target_interval").notNull().default(64),
|
||||
tpRolesEnabled: boolean("tp_roles_enabled").notNull().default(false),
|
||||
isAvailableRoleId: bigint("is_available_role_id", { mode: "bigint" }),
|
||||
wantsToBeNotifieRoledId: bigint("wants_to_be_notified_role_id", {
|
||||
mode: "bigint",
|
||||
}),
|
||||
});
|
||||
|
||||
export const guildsRelations = relations(guilds, ({ many }) => ({
|
||||
|
@ -57,9 +59,9 @@ export const guildsRelations = relations(guilds, ({ many }) => ({
|
|||
export const tpMessages = pgTable(
|
||||
"tp_messages",
|
||||
{
|
||||
messageId: integer("message_id"),
|
||||
messageId: bigint("message_id", { mode: "bigint" }),
|
||||
day: smallint("day").notNull(),
|
||||
guildId: integer("guild_id")
|
||||
guildId: bigint("guild_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => guilds.id, { onDelete: "cascade" }),
|
||||
},
|
||||
|
@ -79,14 +81,14 @@ export const tpMessagesRelations = relations(tpMessages, ({ one }) => ({
|
|||
|
||||
export const matches = pgTable("matches", {
|
||||
id: serial("id").primaryKey(),
|
||||
channelId: integer("channel_id").notNull(),
|
||||
channelId: bigint("channel_id", { mode: "bigint" }).notNull(),
|
||||
matchType: varchar("match_type", { length: 50 }).notNull(),
|
||||
createrId: integer("creater_id").notNull(),
|
||||
roleId: integer("role_id").notNull(),
|
||||
createrId: bigint("creater_id", { mode: "bigint" }).notNull(),
|
||||
roleId: bigint("role_id", { mode: "bigint" }).notNull(),
|
||||
opponentName: varchar("opponent_name", { length: 100 }).notNull(),
|
||||
messageId: integer("message_id").notNull(),
|
||||
messageId: bigint("message_id", { mode: "bigint" }).notNull(),
|
||||
utc_ts: timestamp("utc_ts").notNull(),
|
||||
guildId: integer("guild_id")
|
||||
guildId: bigint("guild_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => guilds.id, { onDelete: "cascade" }),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue