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