Add queue banners/counts on ticket detail pages, document local-only photo purge, and harden Drizzle Kit smoke contracts after Prisma removal. Co-authored-by: Cursor <[email protected]>
2570 lines
94 KiB
TypeScript
2570 lines
94 KiB
TypeScript
// AUTO-GENERATED by scripts/generate-drizzle-schema.mjs — DO NOT EDIT.
|
|
// TS field names come from the previous src/db/schema.ts; column types from the
|
|
// live MySQL DB. Run `pnpm db:schema:generate` after schema/map changes.
|
|
|
|
import { sql } from "drizzle-orm";
|
|
import {
|
|
bigint,
|
|
binary,
|
|
boolean,
|
|
customType,
|
|
datetime,
|
|
decimal,
|
|
double,
|
|
int,
|
|
longtext,
|
|
mediumtext,
|
|
mysqlEnum,
|
|
mysqlTable,
|
|
primaryKey,
|
|
text,
|
|
timestamp,
|
|
tinyint,
|
|
uniqueIndex,
|
|
varchar,
|
|
} from "drizzle-orm/mysql-core";
|
|
|
|
// MySQL TIME / DATE columns are hydrated as JS Date (epoch 1970-01-01
|
|
// for TIME). Mirror that so existing call sites keep working unchanged.
|
|
const timeAsDate = customType<{ data: Date; driverData: string }>({
|
|
dataType() {
|
|
return "time";
|
|
},
|
|
toDriver(value) {
|
|
return value.toISOString().slice(11, 19);
|
|
},
|
|
fromDriver(value) {
|
|
return new Date(`1970-01-01T${value}Z`);
|
|
},
|
|
});
|
|
|
|
const dateAsDate = customType<{ data: Date; driverData: string }>({
|
|
dataType() {
|
|
return "date";
|
|
},
|
|
toDriver(value) {
|
|
return value.toISOString().slice(0, 10);
|
|
},
|
|
fromDriver(value) {
|
|
return new Date(`${value}T00:00:00Z`);
|
|
},
|
|
});
|
|
|
|
export const User = mysqlTable("users", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
username: varchar("username", { length: 25 }).unique().notNull(),
|
|
realName: varchar("real_name", { length: 25 }).notNull().default("KREWS DEV"),
|
|
password: varchar("password", { length: 255 }).notNull(),
|
|
mail: varchar("mail", { length: 500 }),
|
|
mailVerified: varchar("mail_verified", { length: 1 }).notNull().default("0"),
|
|
accountCreated: int("account_created").notNull(),
|
|
accountDayOfBirth: int("account_day_of_birth").notNull().default(0),
|
|
lastLogin: int("last_login").notNull().default(0),
|
|
lastOnline: int("last_online").notNull().default(0),
|
|
motto: varchar("motto", { length: 127 }).notNull().default(""),
|
|
look: varchar("look", { length: 256 }).notNull().default(""),
|
|
gender: mysqlEnum("gender", ["M", "F"]).notNull().default("M"),
|
|
rank: int("rank").notNull().default(1),
|
|
credits: int("credits").notNull().default(2500),
|
|
pixels: int("pixels").notNull().default(500),
|
|
points: int("points").notNull().default(10),
|
|
online: varchar("online", { length: 1 }).notNull().default("0"),
|
|
authTicket: varchar("auth_ticket", { length: 256 }).notNull().default(""),
|
|
ipRegister: varchar("ip_register", { length: 255 }).notNull(),
|
|
ipCurrent: varchar("ip_current", { length: 255 }).notNull(),
|
|
machineId: varchar("machine_id", { length: 64 }).notNull().default(""),
|
|
homeRoom: int("home_room").notNull().default(0),
|
|
secretKey: varchar("secret_key", { length: 40 }),
|
|
pincode: varchar("pincode", { length: 11 }),
|
|
extraRank: int("extra_rank"),
|
|
twoFactorSecret: text("two_factor_secret"),
|
|
twoFactorRecoveryCodes: text("two_factor_recovery_codes"),
|
|
twoFactorConfirmedAt: timestamp("two_factor_confirmed_at"),
|
|
websiteJwtVersion: int("website_jwt_version").notNull().default(0),
|
|
});
|
|
|
|
export const UsersCurrency = mysqlTable(
|
|
"users_currency",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
type: int("type").notNull(),
|
|
amount: int("amount").notNull().default(0),
|
|
},
|
|
(t) => [primaryKey({ columns: [t.userId, t.type] })],
|
|
);
|
|
|
|
export const Ban = mysqlTable("bans", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull(),
|
|
ip: varchar("ip", { length: 50 }).notNull().default(""),
|
|
machineId: varchar("machine_id", { length: 255 }).notNull().default(""),
|
|
userStaffId: int("user_staff_id").notNull(),
|
|
timestamp: int("timestamp").notNull(),
|
|
banExpire: int("ban_expire").notNull().default(0),
|
|
banReason: varchar("ban_reason", { length: 200 }).notNull().default(""),
|
|
type: mysqlEnum("type", ["account", "ip", "machine", "super"])
|
|
.notNull()
|
|
.default("account"),
|
|
cfhTopic: int("cfh_topic").notNull().default(-1),
|
|
});
|
|
|
|
export const WebsiteSetting = mysqlTable("website_settings", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
key: varchar("key", { length: 255 }).unique().notNull(),
|
|
value: text("value").notNull(),
|
|
comment: varchar("comment", { length: 255 }),
|
|
});
|
|
|
|
export const PasswordReset = mysqlTable("password_resets", {
|
|
email: varchar("email", { length: 255 }).primaryKey().notNull(),
|
|
token: varchar("token", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
});
|
|
|
|
export const Achievements = mysqlTable(
|
|
"achievements",
|
|
{
|
|
id: int("id").autoincrement().unique().notNull(),
|
|
name: varchar("name", { length: 64 }).notNull().default("ACH_"),
|
|
category: varchar("category", { length: 12 }).notNull().default("identity"),
|
|
level: int("level").notNull().default(1),
|
|
rewardAmount: int("reward_amount").notNull().default(100),
|
|
rewardType: int("reward_type").notNull().default(0),
|
|
points: int("points").default(10),
|
|
progressNeeded: int("progress_needed").notNull().default(1),
|
|
},
|
|
(t) => [primaryKey({ columns: [t.name, t.level] })],
|
|
);
|
|
|
|
export const CalendarCampaigns = mysqlTable("calendar_campaigns", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
name: varchar("name", { length: 255 }).notNull().default(""),
|
|
image: varchar("image", { length: 255 }).notNull().default(""),
|
|
startTimestamp: int("start_timestamp").notNull().default(0),
|
|
totalDays: int("total_days").notNull().default(30),
|
|
lockExpired: varchar("lock_expired", { length: 1 }).notNull().default("1"),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
});
|
|
|
|
export const CalendarRewards = mysqlTable("calendar_rewards", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
campaignId: int("campaign_id").notNull().default(0),
|
|
productName: varchar("product_name", { length: 128 }).notNull().default(""),
|
|
customImage: varchar("custom_image", { length: 128 }).notNull().default(""),
|
|
credits: int("credits").notNull().default(0),
|
|
pixels: int("pixels").notNull().default(0),
|
|
points: int("points").notNull().default(0),
|
|
pointsType: int("points_type").notNull().default(0),
|
|
badge: varchar("badge", { length: 25 }).notNull().default(""),
|
|
itemId: int("item_id").notNull().default(0),
|
|
subscriptionType: varchar("subscription_type", { length: 128 }).default(""),
|
|
subscriptionDays: int("subscription_days").notNull().default(0),
|
|
});
|
|
|
|
export const CameraWeb = mysqlTable("camera_web", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull(),
|
|
roomId: int("room_id").notNull().default(0),
|
|
timestamp: int("timestamp").notNull(),
|
|
url: varchar("url", { length: 128 }).notNull().default(""),
|
|
});
|
|
|
|
export const CatalogItems = mysqlTable("catalog_items", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
itemIds: varchar("item_ids", { length: 666 }).notNull(),
|
|
pageId: int("page_id").notNull(),
|
|
catalogName: varchar("catalog_name", { length: 100 }).notNull(),
|
|
costCredits: int("cost_credits").notNull().default(3),
|
|
costPoints: int("cost_points").notNull().default(0),
|
|
pointsType: int("points_type").notNull().default(0),
|
|
amount: int("amount").notNull().default(1),
|
|
limitedStack: int("limited_stack").notNull().default(0),
|
|
limitedSells: int("limited_sells").notNull().default(0),
|
|
orderNumber: int("order_number").notNull().default(1),
|
|
offerId: int("offer_id").notNull().default(-1),
|
|
songId: int("song_id", { unsigned: true }).notNull().default(0),
|
|
extradata: varchar("extradata", { length: 500 }).notNull().default(""),
|
|
haveOffer: varchar("haveOffer", { length: 255 }).notNull().default("1"),
|
|
clubOnly: varchar("club_only", { length: 1 }).notNull().default("0"),
|
|
});
|
|
|
|
export const CatalogItemsBc = mysqlTable("catalog_items_bc", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
itemIds: varchar("item_ids", { length: 666 }).notNull(),
|
|
pageId: int("page_id").notNull(),
|
|
catalogName: varchar("catalog_name", { length: 100 }).notNull(),
|
|
orderNumber: int("order_number").notNull().default(1),
|
|
extradata: varchar("extradata", { length: 500 }).notNull().default(""),
|
|
});
|
|
|
|
export const CatalogPages = mysqlTable("catalog_pages", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
parentId: int("parent_id").notNull().default(-1),
|
|
captionSave: varchar("caption_save", { length: 25 }).notNull().default(""),
|
|
caption: varchar("caption", { length: 128 }).notNull(),
|
|
pageLayout: varchar("page_layout", { length: 26 })
|
|
.notNull()
|
|
.default("default_3x3"),
|
|
iconColor: int("icon_color").notNull().default(1),
|
|
iconImage: int("icon_image").notNull().default(1),
|
|
minRank: int("min_rank").notNull().default(1),
|
|
orderNum: int("order_num").notNull().default(1),
|
|
visible: varchar("visible", { length: 1 }).notNull().default("1"),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
clubOnly: varchar("club_only", { length: 1 }).notNull().default("0"),
|
|
vipOnly: varchar("vip_only", { length: 1 }).notNull().default("0"),
|
|
pageHeadline: varchar("page_headline", { length: 1024 })
|
|
.notNull()
|
|
.default(""),
|
|
pageTeaser: varchar("page_teaser", { length: 64 }).notNull().default(""),
|
|
pageSpecial: varchar("page_special", { length: 2048 }),
|
|
pageText1: text("page_text1"),
|
|
pageText2: text("page_text2"),
|
|
pageTextDetails: text("page_text_details"),
|
|
pageTextTeaser: text("page_text_teaser"),
|
|
roomId: int("room_id").default(0),
|
|
includes: varchar("includes", { length: 128 }).notNull().default(""),
|
|
});
|
|
|
|
export const CatalogPagesBc = mysqlTable("catalog_pages_bc", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
parentId: int("parent_id").notNull().default(-1),
|
|
caption: varchar("caption", { length: 128 }).notNull(),
|
|
pageLayout: varchar("page_layout", { length: 26 })
|
|
.notNull()
|
|
.default("default_3x3"),
|
|
iconColor: int("icon_color").notNull().default(1),
|
|
iconImage: int("icon_image").notNull().default(1),
|
|
orderNum: int("order_num").notNull().default(1),
|
|
visible: varchar("visible", { length: 1 }).notNull().default("1"),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
pageHeadline: varchar("page_headline", { length: 1024 })
|
|
.notNull()
|
|
.default(""),
|
|
pageTeaser: varchar("page_teaser", { length: 64 }).notNull().default(""),
|
|
pageSpecial: varchar("page_special", { length: 2048 }),
|
|
pageText1: text("page_text1"),
|
|
pageText2: text("page_text2"),
|
|
pageTextDetails: text("page_text_details"),
|
|
pageTextTeaser: text("page_text_teaser"),
|
|
});
|
|
|
|
export const EmulatorErrors = mysqlTable("emulator_errors", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
timestamp: int("timestamp").notNull().default(0),
|
|
version: varchar("version", { length: 64 }).notNull(),
|
|
buildHash: varchar("build_hash", { length: 64 }).notNull(),
|
|
type: varchar("type", { length: 32 }).notNull().default("Exception"),
|
|
stacktrace: binary("stacktrace").notNull(),
|
|
});
|
|
|
|
export const EmulatorSettings = mysqlTable("emulator_settings", {
|
|
key: varchar("key", { length: 100 }).primaryKey().notNull(),
|
|
value: varchar("value", { length: 512 }).notNull(),
|
|
});
|
|
|
|
export const EmulatorTexts = mysqlTable("emulator_texts", {
|
|
key: varchar("key", { length: 100 }).primaryKey().notNull(),
|
|
value: varchar("value", { length: 4096 }).notNull(),
|
|
});
|
|
|
|
export const Guilds = mysqlTable("guilds", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
name: varchar("name", { length: 50 }).notNull().default(""),
|
|
description: varchar("description", { length: 250 }).notNull().default(""),
|
|
roomId: int("room_id").notNull().default(0),
|
|
state: int("state").notNull().default(0),
|
|
rights: varchar("rights", { length: 1 }).notNull().default("0"),
|
|
colorOne: int("color_one").notNull().default(0),
|
|
colorTwo: int("color_two").notNull().default(0),
|
|
badge: varchar("badge", { length: 256 }).notNull().default(""),
|
|
dateCreated: int("date_created").notNull(),
|
|
forum: varchar("forum", { length: 1 }).notNull().default("0"),
|
|
readForum: varchar("read_forum", { length: 8 }).notNull().default("EVERYONE"),
|
|
postMessages: varchar("post_messages", { length: 8 })
|
|
.notNull()
|
|
.default("EVERYONE"),
|
|
postThreads: varchar("post_threads", { length: 8 })
|
|
.notNull()
|
|
.default("EVERYONE"),
|
|
modForum: varchar("mod_forum", { length: 6 }).notNull().default("ADMINS"),
|
|
});
|
|
|
|
export const GuildsForumsComments = mysqlTable("guilds_forums_comments", {
|
|
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
|
threadId: int("thread_id", { unsigned: true }).notNull().default(0),
|
|
userId: int("user_id").notNull().default(0),
|
|
message: text("message").notNull(),
|
|
createdAt: int("created_at").notNull().default(0),
|
|
state: int("state").notNull().default(0),
|
|
adminId: int("admin_id").notNull().default(0),
|
|
});
|
|
|
|
export const GuildsForumsThreads = mysqlTable("guilds_forums_threads", {
|
|
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
|
guildId: int("guild_id").default(0),
|
|
openerId: int("opener_id").default(0),
|
|
subject: varchar("subject", { length: 255 }).default(""),
|
|
postsCount: int("posts_count").default(0),
|
|
createdAt: int("created_at").default(0),
|
|
updatedAt: int("updated_at").default(0),
|
|
state: int("state").default(0),
|
|
pinned: tinyint("pinned").default(0),
|
|
locked: tinyint("locked").default(0),
|
|
adminId: int("admin_id").default(0),
|
|
});
|
|
|
|
export const GuildsMembers = mysqlTable("guilds_members", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
guildId: int("guild_id").notNull().default(0),
|
|
userId: int("user_id").notNull().default(0),
|
|
levelId: int("level_id").notNull().default(0),
|
|
memberSince: int("member_since").notNull().default(0),
|
|
});
|
|
|
|
export const Items = mysqlTable("items", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
roomId: int("room_id").notNull().default(0),
|
|
itemId: int("item_id", { unsigned: true }).default(0),
|
|
wallPos: varchar("wall_pos", { length: 20 }).notNull().default(""),
|
|
x: int("x").notNull().default(0),
|
|
y: int("y").notNull().default(0),
|
|
z: double("z").notNull().default(0.0),
|
|
rot: int("rot").notNull().default(0),
|
|
extraData: varchar("extra_data", { length: 1024 }).notNull().default(""),
|
|
wiredData: varchar("wired_data", { length: 10000 }).notNull().default(""),
|
|
limitedData: varchar("limited_data", { length: 10 }).notNull().default("0:0"),
|
|
guildId: int("guild_id").notNull().default(0),
|
|
});
|
|
|
|
export const ItemsBase = mysqlTable("items_base", {
|
|
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
|
spriteId: int("sprite_id").notNull().default(0),
|
|
publicName: varchar("public_name", { length: 56 }).notNull().default(""),
|
|
itemName: varchar("item_name", { length: 70 }).notNull(),
|
|
type: varchar("type", { length: 3 }).notNull().default("s"),
|
|
width: int("width").notNull().default(1),
|
|
length: int("length").notNull().default(1),
|
|
stackHeight: double("stack_height").notNull().default(0.0),
|
|
allowStack: tinyint("allow_stack").notNull().default(1),
|
|
allowSit: tinyint("allow_sit").notNull().default(0),
|
|
allowLay: tinyint("allow_lay").notNull().default(0),
|
|
allowWalk: tinyint("allow_walk").notNull().default(0),
|
|
allowGift: tinyint("allow_gift").notNull().default(1),
|
|
allowTrade: tinyint("allow_trade").notNull().default(1),
|
|
allowRecycle: tinyint("allow_recycle").notNull().default(0),
|
|
allowMarketplaceSell: tinyint("allow_marketplace_sell").notNull().default(0),
|
|
allowInventoryStack: tinyint("allow_inventory_stack").notNull().default(1),
|
|
interactionType: varchar("interaction_type", { length: 500 })
|
|
.notNull()
|
|
.default("default"),
|
|
interactionModesCount: int("interaction_modes_count").notNull().default(1),
|
|
vendingIds: varchar("vending_ids", { length: 255 }).notNull().default("0"),
|
|
multiheight: varchar("multiheight", { length: 50 }).notNull().default("0"),
|
|
customparams: varchar("customparams", { length: 25600 })
|
|
.notNull()
|
|
.default(""),
|
|
effectIdMale: int("effect_id_male").notNull().default(0),
|
|
effectIdFemale: int("effect_id_female").notNull().default(0),
|
|
clothingOnWalk: varchar("clothing_on_walk", { length: 255 })
|
|
.notNull()
|
|
.default(""),
|
|
});
|
|
|
|
export const LogsShopPurchases = mysqlTable("logs_shop_purchases", {
|
|
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
|
timestamp: int("timestamp", { unsigned: true }),
|
|
userId: int("user_id"),
|
|
catalogItemId: int("catalog_item_id", { unsigned: true }),
|
|
itemIds: text("item_ids"),
|
|
catalogName: varchar("catalog_name", { length: 255 }),
|
|
costCredits: int("cost_credits"),
|
|
costPoints: int("cost_points"),
|
|
pointsType: int("points_type"),
|
|
amount: int("amount"),
|
|
});
|
|
|
|
export const MarketplaceItems = mysqlTable("marketplace_items", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
itemId: int("item_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
price: int("price").notNull(),
|
|
timestamp: int("timestamp").notNull(),
|
|
soldTimestamp: int("sold_timestamp").notNull().default(0),
|
|
state: int("state").notNull().default(1),
|
|
});
|
|
|
|
export const MessengerFriendrequests = mysqlTable("messenger_friendrequests", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userToId: int("user_to_id").notNull().default(0),
|
|
userFromId: int("user_from_id").notNull().default(0),
|
|
});
|
|
|
|
export const MessengerFriendships = mysqlTable("messenger_friendships", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userOneId: int("user_one_id").notNull().default(0),
|
|
userTwoId: int("user_two_id").notNull().default(0),
|
|
relation: int("relation").notNull().default(0),
|
|
friendsSince: int("friends_since").notNull().default(0),
|
|
category: int("category").notNull().default(0),
|
|
});
|
|
|
|
export const MessengerOffline = mysqlTable("messenger_offline", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
userFromId: int("user_from_id").notNull().default(0),
|
|
message: varchar("message", { length: 500 }).notNull(),
|
|
sendedOn: int("sended_on").notNull(),
|
|
});
|
|
|
|
export const NavigatorFlatcats = mysqlTable("navigator_flatcats", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
minRank: int("min_rank").notNull().default(0),
|
|
captionSave: varchar("caption_save", { length: 32 })
|
|
.notNull()
|
|
.default("caption_save"),
|
|
caption: varchar("caption", { length: 100 }).notNull(),
|
|
canTrade: varchar("canTrade", { length: 255 }).notNull().default("1"),
|
|
maxUserCount: int("max_user_count").notNull().default(100),
|
|
public: varchar("public", { length: 1 }).notNull().default("0"),
|
|
listType: int("list_type").notNull().default(0),
|
|
orderNum: int("order_num").notNull().default(0),
|
|
});
|
|
|
|
export const NavigatorPubliccats = mysqlTable("navigator_publiccats", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
name: varchar("name", { length: 32 }).notNull().default("Staff Picks"),
|
|
image: varchar("image", { length: 1 }).notNull().default("0"),
|
|
visible: varchar("visible", { length: 1 }).notNull().default("1"),
|
|
orderNum: int("order_num").notNull().default(0),
|
|
});
|
|
|
|
export const RoomTradeLog = mysqlTable("room_trade_log", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userOneId: int("user_one_id").notNull(),
|
|
userTwoId: int("user_two_id").notNull(),
|
|
userOneIp: varchar("user_one_ip", { length: 45 }).notNull(),
|
|
userTwoIp: varchar("user_two_ip", { length: 45 }).notNull(),
|
|
timestamp: int("timestamp").notNull(),
|
|
userOneItemCount: int("user_one_item_count").notNull(),
|
|
userTwoItemCount: int("user_two_item_count").notNull(),
|
|
});
|
|
|
|
export const Rooms = mysqlTable("rooms", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
ownerId: int("owner_id").notNull().default(0),
|
|
ownerName: varchar("owner_name", { length: 25 }).notNull().default(""),
|
|
name: varchar("name", { length: 50 }).notNull().default(""),
|
|
description: varchar("description", { length: 512 }).notNull().default(""),
|
|
model: varchar("model", { length: 20 }).notNull().default("model_a"),
|
|
password: varchar("password", { length: 20 }).notNull().default(""),
|
|
state: varchar("state", { length: 9 }).notNull().default("open"),
|
|
users: int("users").notNull().default(0),
|
|
usersMax: int("users_max").notNull().default(25),
|
|
guildId: int("guild_id").notNull().default(0),
|
|
category: int("category").notNull().default(1),
|
|
score: int("score").notNull().default(0),
|
|
paperFloor: varchar("paper_floor", { length: 50 }).notNull().default("0.0"),
|
|
paperWall: varchar("paper_wall", { length: 50 }).notNull().default("0.0"),
|
|
paperLandscape: varchar("paper_landscape", { length: 50 })
|
|
.notNull()
|
|
.default("0.0"),
|
|
thicknessWall: int("thickness_wall").notNull().default(0),
|
|
wallHeight: int("wall_height").notNull().default(-1),
|
|
thicknessFloor: int("thickness_floor").notNull().default(0),
|
|
moodlightData: varchar("moodlight_data", { length: 254 })
|
|
.notNull()
|
|
.default("2,1,1,#000000,255;2,3,1,#000000,255;2,3,1,#000000,255;"),
|
|
tags: varchar("tags", { length: 500 }).notNull().default(""),
|
|
isPublic: varchar("is_public", { length: 1 }).notNull().default("0"),
|
|
isStaffPicked: varchar("is_staff_picked", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
allowOtherPets: varchar("allow_other_pets", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
allowOtherPetsEat: varchar("allow_other_pets_eat", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
allowWalkthrough: varchar("allow_walkthrough", { length: 1 })
|
|
.notNull()
|
|
.default("1"),
|
|
allowHidewall: varchar("allow_hidewall", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
chatMode: int("chat_mode").notNull().default(0),
|
|
chatWeight: int("chat_weight").notNull().default(1),
|
|
chatSpeed: int("chat_speed").notNull().default(1),
|
|
chatHearingDistance: int("chat_hearing_distance").notNull().default(50),
|
|
chatProtection: int("chat_protection").notNull().default(2),
|
|
overrideModel: varchar("override_model", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
whoCanMute: int("who_can_mute").notNull().default(0),
|
|
whoCanKick: int("who_can_kick").notNull().default(0),
|
|
whoCanBan: int("who_can_ban").notNull().default(0),
|
|
pollId: int("poll_id").notNull().default(0),
|
|
rollerSpeed: int("roller_speed").notNull().default(4),
|
|
promoted: varchar("promoted", { length: 1 }).notNull().default("0"),
|
|
tradeMode: int("trade_mode").notNull().default(2),
|
|
moveDiagonally: varchar("move_diagonally", { length: 1 })
|
|
.notNull()
|
|
.default("1"),
|
|
jukeboxActive: varchar("jukebox_active", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
hidewired: varchar("hidewired", { length: 1 }).notNull().default("0"),
|
|
isForSale: varchar("is_forsale", { length: 1 }).notNull().default("0"),
|
|
});
|
|
|
|
export const Soundtracks = mysqlTable("soundtracks", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
code: varchar("code", { length: 32 }).notNull(),
|
|
name: varchar("name", { length: 100 }).notNull(),
|
|
author: varchar("author", { length: 50 }).notNull(),
|
|
track: text("track").notNull(),
|
|
length: int("length").notNull().default(0),
|
|
});
|
|
|
|
export const SupportTickets = mysqlTable("support_tickets", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
state: int("state").notNull().default(0),
|
|
type: int("type").notNull().default(1),
|
|
timestamp: int("timestamp").notNull().default(0),
|
|
score: int("score").notNull().default(0),
|
|
senderId: int("sender_id").notNull().default(0),
|
|
reportedId: int("reported_id").notNull().default(0),
|
|
roomId: int("room_id").notNull().default(0),
|
|
modId: int("mod_id").notNull().default(0),
|
|
issue: varchar("issue", { length: 500 }).notNull().default(""),
|
|
category: int("category").notNull().default(0),
|
|
groupId: int("group_id").notNull(),
|
|
threadId: int("thread_id").notNull(),
|
|
commentId: int("comment_id").notNull(),
|
|
photoItemId: int("photo_item_id").notNull().default(-1),
|
|
});
|
|
|
|
export const UsersBadges = mysqlTable("users_badges", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
slotId: int("slot_id").notNull().default(0),
|
|
badgeCode: varchar("badge_code", { length: 32 }).notNull(),
|
|
});
|
|
|
|
export const UsersSettings = mysqlTable("users_settings", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").unique().notNull().default(0),
|
|
credits: int("credits").notNull().default(0),
|
|
achievementScore: int("achievement_score").notNull().default(0),
|
|
dailyRespectPoints: int("daily_respect_points").notNull().default(3),
|
|
dailyPetRespectPoints: int("daily_pet_respect_points").notNull().default(3),
|
|
respectsGiven: int("respects_given").notNull().default(0),
|
|
respectsReceived: int("respects_received").notNull().default(0),
|
|
guildId: int("guild_id").notNull().default(0),
|
|
canChangeName: varchar("can_change_name", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
canTrade: varchar("can_trade", { length: 1 }).notNull().default("1"),
|
|
isCitizen: varchar("is_citizen", { length: 1 }).notNull().default("0"),
|
|
citizenLevel: int("citizen_level").notNull().default(0),
|
|
helperLevel: int("helper_level").notNull().default(0),
|
|
tradelockAmount: int("tradelock_amount").notNull().default(0),
|
|
cfhSend: int("cfh_send").notNull().default(0),
|
|
cfhAbusive: int("cfh_abusive").notNull().default(0),
|
|
cfhWarnings: int("cfh_warnings").notNull().default(0),
|
|
cfhBans: int("cfh_bans").notNull().default(0),
|
|
blockFollowing: varchar("block_following", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
blockFriendrequests: varchar("block_friendrequests", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
blockRoominvites: varchar("block_roominvites", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
volumeSystem: int("volume_system").notNull().default(100),
|
|
volumeFurni: int("volume_furni").notNull().default(100),
|
|
volumeTrax: int("volume_trax").notNull().default(100),
|
|
oldChat: varchar("old_chat", { length: 1 }).notNull().default("0"),
|
|
blockCameraFollow: varchar("block_camera_follow", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
chatColor: int("chat_color").notNull().default(0),
|
|
homeRoom: int("home_room").notNull().default(0),
|
|
onlineTime: int("online_time").notNull().default(0),
|
|
tags: varchar("tags", { length: 255 })
|
|
.notNull()
|
|
.default("Arcturus Emulator;"),
|
|
clubExpireTimestamp: int("club_expire_timestamp").notNull().default(0),
|
|
loginStreak: int("login_streak").notNull().default(0),
|
|
rentSpaceId: int("rent_space_id").notNull().default(0),
|
|
rentSpaceEndtime: int("rent_space_endtime").notNull().default(0),
|
|
hofPoints: int("hof_points").notNull().default(0),
|
|
blockAlerts: varchar("block_alerts", { length: 1 }).notNull().default("0"),
|
|
talentTrackCitizenshipLevel: int("talent_track_citizenship_level")
|
|
.notNull()
|
|
.default(-1),
|
|
talentTrackHelpersLevel: int("talent_track_helpers_level")
|
|
.notNull()
|
|
.default(-1),
|
|
ignoreBots: varchar("ignore_bots", { length: 1 }).notNull().default("0"),
|
|
ignorePets: varchar("ignore_pets", { length: 1 }).notNull().default("0"),
|
|
nux: varchar("nux", { length: 1 }).notNull().default("0"),
|
|
muteEndTimestamp: int("mute_end_timestamp").notNull().default(0),
|
|
allowNameChange: varchar("allow_name_change", { length: 1 })
|
|
.notNull()
|
|
.default("0"),
|
|
perkTrade: varchar("perk_trade", { length: 1 }).notNull().default("0"),
|
|
forumsPostCount: int("forums_post_count").default(0),
|
|
uiFlags: int("ui_flags").notNull().default(1),
|
|
hasGottenDefaultSavedSearches: tinyint("has_gotten_default_saved_searches")
|
|
.notNull()
|
|
.default(0),
|
|
hcGiftsClaimed: int("hc_gifts_claimed").default(0),
|
|
lastHcPayday: int("last_hc_payday").default(0),
|
|
maxRooms: int("max_rooms").default(50),
|
|
maxFriends: int("max_friends").default(300),
|
|
});
|
|
|
|
export const WebsiteArticles = mysqlTable("website_articles", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
slug: varchar("slug", { length: 255 }).unique().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
shortStory: varchar("short_story", { length: 255 }).notNull(),
|
|
fullStory: longtext("full_story").notNull(),
|
|
userId: int("user_id"),
|
|
image: varchar("image", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteLanguages = mysqlTable("website_languages", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
countryCode: varchar("country_code", { length: 8 }).unique().notNull(),
|
|
language: varchar("language", { length: 255 }).unique().notNull(),
|
|
});
|
|
|
|
export const UserReferrals = mysqlTable("user_referrals", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
referralsTotal: bigint("referrals_total", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const Referrals = mysqlTable("referrals", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
referredUserId: bigint("referred_user_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
referredUserIp: varchar("referred_user_ip", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const ClaimedReferralLogs = mysqlTable("claimed_referral_logs", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
ipAddress: varchar("ip_address", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteHousekeepingPermissions = mysqlTable(
|
|
"website_housekeeping_permissions",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
permission: varchar("permission", { length: 255 }).unique().notNull(),
|
|
minRank: int("min_rank").notNull(),
|
|
description: varchar("description", { length: 255 }),
|
|
groupName: varchar("group_name", { length: 100 }),
|
|
dependsOn: varchar("depends_on", { length: 255 }),
|
|
updatedBy: int("updated_by"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteIpWhitelist = mysqlTable("website_ip_whitelist", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
ipAddress: varchar("ip_address", { length: 255 }).notNull(),
|
|
asn: varchar("asn", { length: 255 }),
|
|
whitelistAsn: boolean("whitelist_asn").notNull().default(false),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteIpBlacklist = mysqlTable("website_ip_blacklist", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
ipAddress: varchar("ip_address", { length: 255 }).notNull(),
|
|
asn: varchar("asn", { length: 255 }),
|
|
blacklistAsn: boolean("blacklist_asn").notNull().default(false),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsitePermissions = mysqlTable("website_permissions", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
permission: varchar("permission", { length: 255 }).unique().notNull(),
|
|
minRank: varchar("min_rank", { length: 255 }).notNull(),
|
|
description: varchar("description", { length: 255 }),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteArticleReactions = mysqlTable("website_article_reactions", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id", { unsigned: true }).notNull(),
|
|
articleId: bigint("article_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
reaction: varchar("reaction", { length: 50 }).notNull(),
|
|
active: boolean("active").notNull().default(true),
|
|
});
|
|
|
|
export const WebsiteWordfilter = mysqlTable("website_wordfilter", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
word: varchar("word", { length: 255 }).unique().notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteWriteableBoxes = mysqlTable("website_writeable_boxes", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
icon: varchar("icon", { length: 255 }),
|
|
content: text("content").notNull(),
|
|
position: int("position").notNull().default(0),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteLoginLogs = mysqlTable("website_login_logs", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
ip: varchar("ip", { length: 45 }).notNull(),
|
|
userAgent: varchar("user_agent", { length: 512 }),
|
|
createdAt: timestamp("created_at"),
|
|
});
|
|
|
|
export const WebsiteBetaCodes = mysqlTable("website_beta_codes", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
code: varchar("code", { length: 255 }).unique().notNull(),
|
|
userId: int("user_id"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteTeams = mysqlTable("website_teams", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
rankName: varchar("rank_name", { length: 255 }).unique().notNull(),
|
|
hiddenRank: boolean("hidden_rank").notNull().default(false),
|
|
badge: varchar("badge", { length: 255 }),
|
|
jobDescription: varchar("job_description", { length: 255 }),
|
|
staffColor: varchar("staff_color", { length: 255 })
|
|
.notNull()
|
|
.default("#327fa8"),
|
|
staffBackground: varchar("staff_background", { length: 255 })
|
|
.notNull()
|
|
.default("staff-bg.png"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteStaffApplications = mysqlTable(
|
|
"website_staff_applications",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
rankId: int("rank_id").notNull(),
|
|
content: text("content").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteOpenPositions = mysqlTable("website_open_positions", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
permissionId: int("permission_id").unique().notNull(),
|
|
description: text("description").notNull(),
|
|
applyFrom: timestamp("apply_from"),
|
|
applyTo: timestamp("apply_to"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteArticleComments = mysqlTable("website_article_comments", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
articleId: bigint("article_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
userId: int("user_id").notNull(),
|
|
comment: varchar("comment", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteRareValueCategories = mysqlTable(
|
|
"website_rare_value_categories",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).unique().notNull(),
|
|
badge: varchar("badge", { length: 255 }).notNull(),
|
|
priority: int("priority", { unsigned: true }).notNull().default(1),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteRareValues = mysqlTable("website_rare_values", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
categoryId: bigint("category_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
itemId: int("item_id"),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
creditValue: varchar("credit_value", { length: 255 }),
|
|
currencyValue: varchar("currency_value", { length: 255 }),
|
|
currencyType: varchar("currency_type", { length: 255 })
|
|
.notNull()
|
|
.default("diamonds"),
|
|
furnitureIcon: varchar("furniture_icon", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteRuleCategories = mysqlTable("website_rule_categories", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).unique().notNull(),
|
|
description: varchar("description", { length: 255 }).notNull(),
|
|
badge: varchar("badge", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteRules = mysqlTable("website_rules", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
categoryId: bigint("category_id", { mode: "bigint", unsigned: true }),
|
|
paragraph: varchar("paragraph", { length: 8 }).notNull(),
|
|
rule: text("rule").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteInstallation = mysqlTable("website_installation", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
step: int("step", { unsigned: true }).default(0),
|
|
completed: boolean("completed").notNull().default(false),
|
|
installationKey: varchar("installation_key", { length: 255 }),
|
|
userIp: varchar("user_ip", { length: 255 }),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteHelpCenterCategories = mysqlTable(
|
|
"website_help_center_categories",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).unique().notNull(),
|
|
content: text("content").notNull(),
|
|
position: int("position", { unsigned: true }).notNull().default(1),
|
|
imageUrl: varchar("image_url", { length: 255 }),
|
|
buttonText: varchar("button_text", { length: 255 }),
|
|
buttonUrl: varchar("button_url", { length: 255 }),
|
|
buttonColor: varchar("button_color", { length: 16 })
|
|
.notNull()
|
|
.default("#eeb425"),
|
|
buttonBorderColor: varchar("button_border_color", { length: 16 })
|
|
.notNull()
|
|
.default("#facc15"),
|
|
smallBox: boolean("small_box").notNull().default(false),
|
|
},
|
|
);
|
|
|
|
export const WebsiteHelpCenterTickets = mysqlTable(
|
|
"website_help_center_tickets",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id"),
|
|
categoryId: bigint("category_id", { mode: "bigint", unsigned: true }),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
content: text("content").notNull(),
|
|
open: boolean("open").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsitePaypalTransactions = mysqlTable(
|
|
"website_paypal_transactions",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
transactionId: varchar("transaction_id", { length: 255 }).notNull(),
|
|
status: varchar("status", { length: 255 }),
|
|
description: varchar("description", { length: 512 }),
|
|
amount: double("amount").notNull(),
|
|
currency: varchar("currency", { length: 255 }).notNull().default("USD"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteShopArticles = mysqlTable("website_shop_articles", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
categoryId: bigint("website_shop_category_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}),
|
|
name: varchar("name", { length: 255 }).unique().notNull(),
|
|
info: varchar("info", { length: 255 }).notNull(),
|
|
iconUrl: varchar("icon_url", { length: 255 }).notNull(),
|
|
color: varchar("color", { length: 255 }).notNull(),
|
|
costs: int("costs", { unsigned: true }).notNull(),
|
|
giveRank: int("give_rank"),
|
|
isGiftable: boolean("is_giftable").notNull().default(false),
|
|
credits: int("credits", { unsigned: true }),
|
|
duckets: int("duckets", { unsigned: true }),
|
|
diamonds: int("diamonds", { unsigned: true }),
|
|
badges: varchar("badges", { length: 255 }),
|
|
furniture: longtext("furniture"),
|
|
position: int("position", { unsigned: true }).notNull().default(0),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteShopVouchers = mysqlTable("website_shop_vouchers", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
code: varchar("code", { length: 255 }).unique().notNull(),
|
|
maxUses: int("max_uses", { unsigned: true }).notNull().default(1),
|
|
useCount: int("use_count", { unsigned: true }).notNull().default(0),
|
|
amount: int("amount", { unsigned: true }).notNull(),
|
|
expiresAt: timestamp("expires_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteUsedShopVouchers = mysqlTable(
|
|
"website_used_shop_vouchers",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
voucherId: bigint("voucher_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteShopArticleFeatures = mysqlTable(
|
|
"website_shop_article_features",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
articleId: bigint("article_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
content: varchar("content", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteHelpCenterTicketReplies = mysqlTable(
|
|
"website_help_center_ticket_replies",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
ticketId: bigint("ticket_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
userId: int("user_id").notNull(),
|
|
content: text("content").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
);
|
|
|
|
export const WebsiteTicket = mysqlTable("website_tickets", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
subject: varchar("subject", { length: 255 }).notNull(),
|
|
category: varchar("category", { length: 50 }).notNull().default("general"),
|
|
priority: varchar("priority", { length: 20 }).notNull().default("normal"),
|
|
status: varchar("status", { length: 20 }).notNull().default("open"),
|
|
creatorId: int("creator_id").notNull(),
|
|
assigneeId: int("assignee_id"),
|
|
closedAt: datetime("closed_at"),
|
|
createdAt: datetime("created_at").notNull().default(sql`CURRENT_TIMESTAMP`),
|
|
updatedAt: datetime("updated_at").notNull(),
|
|
});
|
|
|
|
export const WebsiteTicketMessage = mysqlTable("website_ticket_messages", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
ticketId: int("ticket_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
message: text("message").notNull(),
|
|
isStaff: int("is_staff").notNull().default(0),
|
|
createdAt: datetime("created_at").notNull().default(sql`CURRENT_TIMESTAMP`),
|
|
});
|
|
|
|
export const WebsiteTicketTemplate = mysqlTable("website_ticket_templates", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
content: text("content").notNull(),
|
|
category: varchar("category", { length: 50 }).notNull().default("general"),
|
|
sortOrder: int("sort_order").notNull().default(0),
|
|
createdAt: datetime("created_at").notNull().default(sql`CURRENT_TIMESTAMP`),
|
|
});
|
|
|
|
export const UserWatch = mysqlTable(
|
|
"user_watch",
|
|
{
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
staffId: int("staff_id").notNull(),
|
|
targetUserId: int("target_user_id").notNull(),
|
|
reason: varchar("reason", { length: 255 }).notNull().default(""),
|
|
createdAt: datetime("created_at").notNull().default(sql`CURRENT_TIMESTAMP`),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("user_watch_staffId_targetUserId").on(
|
|
t.staffId,
|
|
t.targetUserId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const AdminAuditLog = mysqlTable("admin_audit_log", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull(),
|
|
action: varchar("action", { length: 191 }).notNull().default(""),
|
|
target: varchar("target", { length: 191 }).notNull().default(""),
|
|
targetId: int("target_id"),
|
|
details: text("details"),
|
|
before: text("before"),
|
|
after: text("after"),
|
|
diff: text("diff"),
|
|
ipAddress: varchar("ip_address", { length: 45 }),
|
|
createdAt: varchar("created_at", { length: 64 }).notNull().default(""),
|
|
updatedAt: varchar("updated_at", { length: 64 }),
|
|
});
|
|
|
|
export const AclRole = mysqlTable("acl_roles", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
slug: varchar("slug", { length: 191 }).unique().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull().default(""),
|
|
description: text("description"),
|
|
createdAt: datetime("created_at").default(sql`CURRENT_TIMESTAMP`),
|
|
updatedAt: datetime("updated_at"),
|
|
});
|
|
|
|
export const AclPermission = mysqlTable("acl_permissions", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
slug: varchar("slug", { length: 191 }).unique().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull().default(""),
|
|
createdAt: datetime("created_at").default(sql`CURRENT_TIMESTAMP`),
|
|
updatedAt: datetime("updated_at"),
|
|
});
|
|
|
|
export const AclModelRole = mysqlTable("acl_model_roles", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
modelType: varchar("model_type", { length: 191 }).notNull().default("User"),
|
|
modelId: int("model_id").notNull(),
|
|
roleId: int("role_id").notNull(),
|
|
});
|
|
|
|
export const AclModelPermission = mysqlTable("acl_model_permissions", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
modelType: varchar("model_type", { length: 191 }).notNull().default("Role"),
|
|
modelId: int("model_id").notNull(),
|
|
permissionId: int("permission_id").notNull(),
|
|
});
|
|
|
|
export const AlertLogs = mysqlTable("alert_logs", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
type: varchar("type", { length: 255 }).notNull(),
|
|
severity: varchar("severity", { length: 255 }).notNull(),
|
|
message: text("message").notNull(),
|
|
context: longtext("context"),
|
|
sentViaEmail: boolean("sent_via_email").notNull().default(false),
|
|
sentViaDiscord: boolean("sent_via_discord").notNull().default(false),
|
|
isRead: boolean("is_read").notNull().default(false),
|
|
readAt: timestamp("read_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteUserGuestbooks = mysqlTable("website_user_guestbooks", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
profileId: int("profile_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
message: varchar("message", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteShopCategories = mysqlTable("website_shop_categories", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
description: text("description"),
|
|
icon: varchar("icon", { length: 255 }),
|
|
order: int("order").notNull().default(0),
|
|
});
|
|
|
|
export const WebsiteMaintenanceTasks = mysqlTable("website_maintenance_tasks", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id"),
|
|
task: varchar("task", { length: 255 }).notNull(),
|
|
completed: boolean("completed").notNull().default(false),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const Tags = mysqlTable("tags", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
backgroundColor: varchar("background_color", { length: 10 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const Taggables = mysqlTable(
|
|
"taggables",
|
|
{
|
|
tagId: bigint("tag_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
taggableId: bigint("taggable_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
taggableType: varchar("taggable_type", { length: 255 }).notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("taggables_tagId_taggableId_taggableType").on(
|
|
t.tagId,
|
|
t.taggableId,
|
|
t.taggableType,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const WebsiteBadges = mysqlTable("website_badges", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
badgeKey: varchar("badge_key", { length: 255 }).unique().notNull(),
|
|
badgeName: varchar("badge_name", { length: 255 }).notNull(),
|
|
badgeDescription: text("badge_description").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteAds = mysqlTable("website_ads", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
image: varchar("image", { length: 255 }).notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteDrawbadges = mysqlTable("website_drawbadges", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id").notNull(),
|
|
badgePath: varchar("badge_path", { length: 255 }).notNull(),
|
|
badgeUrl: varchar("badge_url", { length: 255 }).notNull(),
|
|
badgeName: varchar("badge_name", { length: 255 }).notNull(),
|
|
badgeDesc: varchar("badge_desc", { length: 255 }).notNull(),
|
|
published: boolean("published").notNull().default(false),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioRanks = mysqlTable("radio_ranks", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
description: varchar("description", { length: 255 }),
|
|
badgeCode: varchar("badge_code", { length: 255 }),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioShouts = mysqlTable("radio_shouts", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
message: text("message").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioApplications = mysqlTable("radio_applications", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
realName: varchar("real_name", { length: 255 }).notNull(),
|
|
age: int("age").notNull(),
|
|
availability: text("availability").notNull(),
|
|
experience: text("experience"),
|
|
motivation: text("motivation").notNull(),
|
|
musicStyle: text("music_style"),
|
|
discordUsername: varchar("discord_username", { length: 255 }),
|
|
rankId: bigint("rank_id", { mode: "bigint", unsigned: true }),
|
|
status: varchar("status", { length: 8 }).notNull().default("pending"),
|
|
approvedBy: bigint("approved_by", { mode: "bigint", unsigned: true }),
|
|
approvedAt: timestamp("approved_at"),
|
|
rejectedBy: bigint("rejected_by", { mode: "bigint", unsigned: true }),
|
|
rejectedAt: timestamp("rejected_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioSchedules = mysqlTable("radio_schedules", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
day: varchar("day", { length: 255 }).notNull(),
|
|
startTime: timeAsDate("start_time").notNull(),
|
|
endTime: timeAsDate("end_time").notNull(),
|
|
showName: varchar("show_name", { length: 255 }),
|
|
description: text("description"),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioBanners = mysqlTable("radio_banners", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
imagePath: varchar("image_path", { length: 255 }).notNull(),
|
|
title: varchar("title", { length: 255 }),
|
|
description: text("description"),
|
|
sortOrder: int("sort_order").notNull().default(0),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioHistory = mysqlTable("radio_history", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
showName: varchar("show_name", { length: 255 }),
|
|
startedAt: timestamp("started_at").notNull(),
|
|
endedAt: timestamp("ended_at"),
|
|
listenersCount: int("listeners_count").notNull().default(0),
|
|
notes: text("notes"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioContests = mysqlTable("radio_contests", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
description: text("description"),
|
|
prize: varchar("prize", { length: 255 }),
|
|
startDate: timestamp("start_date"),
|
|
endDate: timestamp("end_date"),
|
|
winnerId: bigint("winner_id", { mode: "bigint", unsigned: true }),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdBy: bigint("created_by", { mode: "bigint", unsigned: true }),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioGiveaways = mysqlTable("radio_giveaways", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
description: text("description"),
|
|
prize: varchar("prize", { length: 255 }),
|
|
prizeAmount: int("prize_amount").notNull().default(0),
|
|
prizeCurrency: varchar("prize_currency", { length: 50 }),
|
|
startDate: timestamp("start_date"),
|
|
endDate: timestamp("end_date"),
|
|
winnerId: bigint("winner_id", { mode: "bigint", unsigned: true }),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdBy: bigint("created_by", { mode: "bigint", unsigned: true }),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioListenerPoints = mysqlTable("radio_listener_points", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
points: decimal("points", { precision: 10, scale: 2, mode: "number" })
|
|
.notNull()
|
|
.default(0),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioSongRequests = mysqlTable("radio_song_requests", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }),
|
|
songTitle: varchar("song_title", { length: 255 }),
|
|
artist: varchar("artist", { length: 255 }),
|
|
isApproved: boolean("is_approved").notNull().default(false),
|
|
isPlayed: boolean("is_played").notNull().default(false),
|
|
votes: int("votes").notNull().default(0),
|
|
submittedAt: timestamp("submitted_at"),
|
|
playedAt: timestamp("played_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioSongVotes = mysqlTable("radio_song_votes", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const GameScores = mysqlTable("game_scores", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: int("user_id", { unsigned: true }).notNull(),
|
|
game: varchar("game", { length: 50 }).notNull(),
|
|
score: int("score").notNull().default(0),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const GameRooms = mysqlTable("game_rooms", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
game: varchar("game", { length: 50 }).notNull(),
|
|
player1Id: int("player1_id", { unsigned: true }).notNull(),
|
|
player2Id: int("player2_id", { unsigned: true }),
|
|
state: longtext("state"),
|
|
turn: int("turn", { unsigned: true }).notNull().default(1),
|
|
winnerId: int("winner_id", { unsigned: true }),
|
|
status: varchar("status", { length: 8 }).notNull().default("waiting"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const GameRewardClaims = mysqlTable(
|
|
"game_reward_claims",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
game: varchar("game", { length: 50 }).notNull(),
|
|
winsRequired: int("wins_required").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("game_reward_claims_userId_game_winsRequired").on(
|
|
t.userId,
|
|
t.game,
|
|
t.winsRequired,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const GameChatMessages = mysqlTable("game_chat_messages", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
roomId: bigint("room_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
message: text("message").notNull(),
|
|
type: varchar("type", { length: 255 }).notNull().default("chat"),
|
|
reactions: longtext("reactions"),
|
|
createdAt: timestamp("created_at").notNull(),
|
|
});
|
|
|
|
export const GameReplays = mysqlTable("game_replays", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
game: varchar("game", { length: 255 }).notNull(),
|
|
player1Id: bigint("player1_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
player2Id: bigint("player2_id", { mode: "bigint", unsigned: true }),
|
|
gameData: longtext("game_data").notNull(),
|
|
moves: longtext("moves").notNull(),
|
|
winner: varchar("winner", { length: 255 }),
|
|
player1Score: int("player1_score").notNull().default(0),
|
|
player2Score: int("player2_score").notNull().default(0),
|
|
startedAt: timestamp("started_at").notNull(),
|
|
endedAt: timestamp("ended_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const GameRanks = mysqlTable("game_ranks", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
slug: varchar("slug", { length: 255 }).unique().notNull(),
|
|
icon: varchar("icon", { length: 255 }).notNull().default("⭐"),
|
|
color: varchar("color", { length: 255 }).notNull().default("#ffffff"),
|
|
minPoints: int("min_points").notNull().default(0),
|
|
maxPoints: int("max_points"),
|
|
tier: int("tier").notNull().default(1),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const UserGameRanks = mysqlTable(
|
|
"user_game_ranks",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
game: varchar("game", { length: 255 }).notNull(),
|
|
rankId: bigint("rank_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
points: int("points").notNull().default(0),
|
|
wins: int("wins").notNull().default(0),
|
|
gamesPlayed: int("games_played").notNull().default(0),
|
|
winStreak: int("win_streak").notNull().default(0),
|
|
bestStreak: int("best_streak").notNull().default(0),
|
|
lastPlayedAt: timestamp("last_played_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
(t) => [uniqueIndex("user_game_ranks_userId_game").on(t.userId, t.game)],
|
|
);
|
|
|
|
export const GameInvitations = mysqlTable("game_invitations", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
fromUserId: bigint("from_user_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
toUserId: bigint("to_user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
game: varchar("game", { length: 255 }).notNull(),
|
|
status: varchar("status", { length: 255 }).notNull().default("pending"),
|
|
betAmount: int("bet_amount").notNull().default(0),
|
|
betCurrency: varchar("bet_currency", { length: 255 })
|
|
.notNull()
|
|
.default("credits"),
|
|
roomId: bigint("room_id", { mode: "bigint", unsigned: true }),
|
|
expiresAt: timestamp("expires_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const UserGameXp = mysqlTable(
|
|
"user_game_xp",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
game: varchar("game", { length: 255 }).notNull(),
|
|
xp: int("xp").notNull().default(0),
|
|
level: int("level").notNull().default(1),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
(t) => [uniqueIndex("user_game_xp_userId_game").on(t.userId, t.game)],
|
|
);
|
|
|
|
export const GameLevelRewards = mysqlTable("game_level_rewards", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
game: varchar("game", { length: 255 }).notNull(),
|
|
level: int("level").notNull(),
|
|
rewardType: varchar("reward_type", { length: 255 }).notNull(),
|
|
rewardCurrency: varchar("reward_currency", { length: 255 }),
|
|
rewardAmount: int("reward_amount").notNull().default(0),
|
|
claimed: boolean("claimed").notNull().default(false),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const DailyChallenges = mysqlTable("daily_challenges", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
description: varchar("description", { length: 255 }).notNull(),
|
|
game: varchar("game", { length: 255 }),
|
|
type: varchar("type", { length: 255 }).notNull(),
|
|
target: int("target").notNull(),
|
|
rewardCurrency: varchar("reward_currency", { length: 255 })
|
|
.notNull()
|
|
.default("credits"),
|
|
rewardAmount: int("reward_amount").notNull(),
|
|
date: dateAsDate("date").notNull(),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const UserChallengeProgress = mysqlTable(
|
|
"user_challenge_progress",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
challengeId: bigint("challenge_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
progress: int("progress").notNull().default(0),
|
|
completed: boolean("completed").notNull().default(false),
|
|
claimed: boolean("claimed").notNull().default(false),
|
|
completedAt: timestamp("completed_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("user_challenge_progress_userId_challengeId").on(
|
|
t.userId,
|
|
t.challengeId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const PersonalAccessTokens = mysqlTable("personal_access_tokens", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
tokenableId: bigint("tokenable_id", {
|
|
mode: "bigint",
|
|
unsigned: true,
|
|
}).notNull(),
|
|
tokenableType: varchar("tokenable_type", { length: 255 }).notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
token: varchar("token", { length: 64 }).unique().notNull(),
|
|
abilities: text("abilities"),
|
|
lastUsedAt: timestamp("last_used_at"),
|
|
expiresAt: timestamp("expires_at"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const StaffActivities = mysqlTable("staff_activities", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
action: varchar("action", { length: 50 }).notNull(),
|
|
targetType: varchar("target_type", { length: 100 }),
|
|
targetId: bigint("target_id", { mode: "bigint", unsigned: true }),
|
|
description: text("description").notNull(),
|
|
ipAddress: varchar("ip_address", { length: 45 }),
|
|
metadata: longtext("metadata"),
|
|
createdAt: timestamp("created_at").notNull().default(sql`CURRENT_TIMESTAMP`),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const EmailTemplates = mysqlTable("email_templates", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).unique().notNull(),
|
|
subject: varchar("subject", { length: 255 }).notNull(),
|
|
body: text("body").notNull(),
|
|
variables: text("variables"),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const SocialAccounts = mysqlTable(
|
|
"social_accounts",
|
|
{
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
userId: bigint("user_id", { mode: "bigint", unsigned: true }).notNull(),
|
|
provider: varchar("provider", { length: 255 }).notNull(),
|
|
providerId: varchar("provider_id", { length: 255 }).notNull(),
|
|
avatar: varchar("avatar", { length: 255 }),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("social_accounts_provider_providerId").on(
|
|
t.provider,
|
|
t.providerId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const RadioApiKeys = mysqlTable("radio_api_keys", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
name: varchar("name", { length: 255 }).notNull(),
|
|
key: varchar("key", { length: 64 }).unique().notNull(),
|
|
allowedIps: varchar("allowed_ips", { length: 255 }),
|
|
permissions: longtext("permissions"),
|
|
rateLimit: int("rate_limit").notNull().default(300),
|
|
lastUsedAt: timestamp("last_used_at"),
|
|
expiresAt: timestamp("expires_at"),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioSongPlays = mysqlTable("radio_song_plays", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
artist: varchar("artist", { length: 255 }),
|
|
album: varchar("album", { length: 255 }),
|
|
artworkUrl: varchar("artwork_url", { length: 255 }),
|
|
duration: int("duration", { unsigned: true }),
|
|
playedAt: timestamp("played_at").notNull(),
|
|
djId: bigint("dj_id", { mode: "bigint", unsigned: true }),
|
|
metadata: longtext("metadata"),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const RadioAutoDjPlaylist = mysqlTable("radio_auto_dj_playlist", {
|
|
id: bigint("id", { mode: "bigint", unsigned: true })
|
|
.autoincrement()
|
|
.primaryKey()
|
|
.notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
artist: varchar("artist", { length: 255 }),
|
|
album: varchar("album", { length: 255 }),
|
|
artworkUrl: varchar("artwork_url", { length: 255 }),
|
|
duration: int("duration", { unsigned: true }),
|
|
playCount: int("play_count", { unsigned: true }).notNull().default(0),
|
|
lastPlayedAt: timestamp("last_played_at"),
|
|
isActive: boolean("is_active").notNull().default(true),
|
|
sortOrder: int("sort_order", { unsigned: true }).notNull().default(0),
|
|
createdAt: timestamp("created_at"),
|
|
updatedAt: timestamp("updated_at"),
|
|
});
|
|
|
|
export const WebsiteBanner = mysqlTable("website_banners", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull().default(""),
|
|
subtitle: varchar("subtitle", { length: 500 }).notNull().default(""),
|
|
image: varchar("image", { length: 500 }).notNull().default(""),
|
|
link: varchar("link", { length: 500 }).notNull().default(""),
|
|
color: varchar("color", { length: 20 }).notNull().default(""),
|
|
isActive: int("is_active").notNull().default(1),
|
|
sortOrder: int("sort_order").notNull().default(0),
|
|
startDate: varchar("start_date", { length: 50 }),
|
|
endDate: varchar("end_date", { length: 50 }),
|
|
});
|
|
|
|
export const WebsiteEventType = mysqlTable("website_event_types", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
name: varchar("name", { length: 100 }).notNull(),
|
|
slug: varchar("slug", { length: 100 }).unique().notNull(),
|
|
description: varchar("description", { length: 500 }).notNull().default(""),
|
|
color: varchar("color", { length: 20 }).notNull().default("#3b82f6"),
|
|
icon: varchar("icon", { length: 50 }).notNull().default("calendar"),
|
|
isActive: int("is_active").notNull().default(1),
|
|
minRank: int("min_rank").notNull().default(0),
|
|
});
|
|
|
|
export const WebsiteEvent = mysqlTable("website_events", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
description: text("description").notNull(),
|
|
typeId: int("type_id").notNull(),
|
|
hostUserId: int("host_user_id").notNull(),
|
|
roomId: int("room_id"),
|
|
startsAt: datetime("starts_at", { fsp: 3 }).notNull(),
|
|
endsAt: datetime("ends_at", { fsp: 3 }),
|
|
maxPlayers: int("max_players"),
|
|
isRecurring: int("is_recurring").notNull().default(0),
|
|
recurrenceRule: varchar("recurrence_rule", { length: 255 }),
|
|
status: varchar("status", { length: 20 }).notNull().default("draft"),
|
|
image: varchar("image", { length: 500 }),
|
|
createdAt: datetime("created_at", { fsp: 3 })
|
|
.notNull()
|
|
.default(sql`CURRENT_TIMESTAMP`),
|
|
updatedAt: datetime("updated_at", { fsp: 3 }).notNull(),
|
|
});
|
|
|
|
export const WebsiteEventRegistration = mysqlTable(
|
|
"website_event_registrations",
|
|
{
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
eventId: int("event_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
createdAt: datetime("created_at", { fsp: 3 })
|
|
.notNull()
|
|
.default(sql`CURRENT_TIMESTAMP`),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("website_event_registrations_eventId_userId").on(
|
|
t.eventId,
|
|
t.userId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const WebsiteEventPrize = mysqlTable("website_event_prizes", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
eventId: int("event_id").notNull(),
|
|
position: int("position").notNull().default(1),
|
|
prizeType: varchar("prize_type", { length: 20 }).notNull().default("badge"),
|
|
badgeCode: varchar("badge_code", { length: 50 }),
|
|
credits: int("credits").notNull().default(0),
|
|
pixels: int("pixels").notNull().default(0),
|
|
points: int("points").notNull().default(0),
|
|
itemId: int("item_id"),
|
|
description: varchar("description", { length: 255 }).notNull().default(""),
|
|
});
|
|
|
|
export const WebsiteEventWinner = mysqlTable(
|
|
"website_event_winners",
|
|
{
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
eventId: int("event_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
position: int("position").notNull().default(1),
|
|
createdAt: datetime("created_at", { fsp: 3 })
|
|
.notNull()
|
|
.default(sql`CURRENT_TIMESTAMP`),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("website_event_winners_eventId_userId").on(t.eventId, t.userId),
|
|
],
|
|
);
|
|
|
|
export const WebsitePoll = mysqlTable("website_polls", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
title: varchar("title", { length: 255 }).notNull(),
|
|
description: text("description"),
|
|
status: varchar("status", { length: 20 }).notNull().default("draft"),
|
|
showResults: int("show_results").notNull().default(1),
|
|
multipleChoice: int("multiple_choice").notNull().default(0),
|
|
startsAt: datetime("starts_at", { fsp: 3 }),
|
|
endsAt: datetime("ends_at", { fsp: 3 }),
|
|
createdAt: datetime("created_at", { fsp: 3 })
|
|
.notNull()
|
|
.default(sql`CURRENT_TIMESTAMP`),
|
|
updatedAt: datetime("updated_at", { fsp: 3 }).notNull(),
|
|
});
|
|
|
|
export const WebsitePollQuestion = mysqlTable("website_poll_questions", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
pollId: int("poll_id").notNull(),
|
|
question: varchar("question", { length: 500 }).notNull(),
|
|
type: varchar("type", { length: 20 }).notNull().default("single"),
|
|
sortOrder: int("sort_order").notNull().default(0),
|
|
options: text("options").notNull(),
|
|
});
|
|
|
|
export const WebsitePollVote = mysqlTable(
|
|
"website_poll_votes",
|
|
{
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
questionId: int("question_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
answer: varchar("answer", { length: 500 }).notNull(),
|
|
createdAt: datetime("created_at", { fsp: 3 })
|
|
.notNull()
|
|
.default(sql`CURRENT_TIMESTAMP`),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("website_poll_votes_questionId_userId").on(
|
|
t.questionId,
|
|
t.userId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const AchievementsTalents = mysqlTable("achievements_talents", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
type: varchar("type", { length: 11 }).notNull().default("citizenship"),
|
|
level: int("level").notNull().default(0),
|
|
achievementIds: varchar("achievement_ids", { length: 100 })
|
|
.notNull()
|
|
.default(""),
|
|
achievementLevels: varchar("achievement_levels", { length: 100 })
|
|
.notNull()
|
|
.default(""),
|
|
rewardFurni: varchar("reward_furni", { length: 100 }).notNull().default(""),
|
|
rewardPerks: varchar("reward_perks", { length: 100 }).notNull().default(""),
|
|
rewardBadges: varchar("reward_badges", { length: 100 }).notNull().default(""),
|
|
});
|
|
|
|
export const Bots = mysqlTable("bots", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
roomId: int("room_id").notNull().default(0),
|
|
name: varchar("name", { length: 25 }).notNull().default(""),
|
|
motto: varchar("motto", { length: 100 }).notNull().default(""),
|
|
figure: varchar("figure", { length: 500 }).notNull().default(""),
|
|
gender: varchar("gender", { length: 1 }).notNull().default("M"),
|
|
x: int("x").notNull().default(0),
|
|
y: int("y").notNull().default(0),
|
|
z: double("z").notNull().default(0.0),
|
|
rot: int("rot").notNull().default(0),
|
|
chatLines: varchar("chat_lines", { length: 5112 }).notNull().default(""),
|
|
chatAuto: varchar("chat_auto", { length: 1 }).notNull().default("1"),
|
|
chatRandom: varchar("chat_random", { length: 1 }).notNull().default("1"),
|
|
chatDelay: int("chat_delay").notNull().default(5),
|
|
dance: int("dance").notNull().default(0),
|
|
freeroam: varchar("freeroam", { length: 1 }).notNull().default("0"),
|
|
type: varchar("type", { length: 32 }).notNull().default("generic"),
|
|
effect: int("effect").notNull().default(0),
|
|
bubbleId: int("bubble_id").default(31),
|
|
});
|
|
|
|
export const CatalogClothing = mysqlTable("catalog_clothing", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
name: varchar("name", { length: 75 }).notNull(),
|
|
setid: varchar("setid", { length: 200 }).notNull(),
|
|
});
|
|
|
|
export const CatalogClubOffers = mysqlTable("catalog_club_offers", {
|
|
id: int("id").primaryKey().notNull(),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
name: varchar("name", { length: 35 }).notNull(),
|
|
days: int("days").notNull(),
|
|
credits: int("credits").notNull().default(10),
|
|
points: int("points").notNull().default(0),
|
|
pointsType: int("points_type").notNull().default(0),
|
|
type: varchar("type", { length: 19 }).notNull().default("HC"),
|
|
deal: varchar("deal", { length: 1 }).notNull().default("0"),
|
|
giftable: varchar("giftable", { length: 1 }).notNull().default("0"),
|
|
});
|
|
|
|
export const CatalogFeaturedPages = mysqlTable("catalog_featured_pages", {
|
|
slotId: int("slot_id").primaryKey().notNull(),
|
|
image: varchar("image", { length: 70 }).notNull().default(""),
|
|
caption: varchar("caption", { length: 130 }).notNull().default(""),
|
|
type: varchar("type", { length: 12 }).notNull().default("page_name"),
|
|
expireTimestamp: int("expire_timestamp").notNull().default(-1),
|
|
pageName: varchar("page_name", { length: 30 }).notNull().default(""),
|
|
pageId: int("page_id").notNull().default(0),
|
|
productName: varchar("product_name", { length: 40 }).notNull().default(""),
|
|
});
|
|
|
|
export const CatalogItemsLimited = mysqlTable(
|
|
"catalog_items_limited",
|
|
{
|
|
catalogItemId: int("catalog_item_id").notNull(),
|
|
number: int("number").notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
timestamp: int("timestamp").notNull().default(0),
|
|
itemId: int("item_id").notNull().default(0),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("catalog_items_limited_catalogItemId_number").on(
|
|
t.catalogItemId,
|
|
t.number,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const CatalogTargetOffers = mysqlTable("catalog_target_offers", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
offerCode: varchar("offer_code", { length: 32 }).notNull(),
|
|
title: varchar("title", { length: 128 }).notNull().default(""),
|
|
description: varchar("description", { length: 2048 }).notNull().default(""),
|
|
image: varchar("image", { length: 128 }).notNull(),
|
|
icon: varchar("icon", { length: 128 }).notNull(),
|
|
endTimestamp: int("end_timestamp").notNull(),
|
|
credits: int("credits").notNull().default(10),
|
|
points: int("points").notNull().default(10),
|
|
pointsType: int("points_type").notNull().default(5),
|
|
purchaseLimit: int("purchase_limit").notNull().default(5),
|
|
catalogItem: int("catalog_item").notNull(),
|
|
vars: varchar("vars", { length: 1024 }).notNull().default(""),
|
|
});
|
|
|
|
export const ChatlogsPrivate = mysqlTable("chatlogs_private", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userFromId: int("user_from_id").notNull(),
|
|
userToId: int("user_to_id").notNull(),
|
|
message: varchar("message", { length: 255 }).notNull(),
|
|
timestamp: int("timestamp").notNull().default(0),
|
|
});
|
|
|
|
export const CraftingAltarsRecipes = mysqlTable(
|
|
"crafting_altars_recipes",
|
|
{
|
|
altarId: int("altar_id").notNull(),
|
|
recipeId: int("recipe_id").notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("crafting_altars_recipes_altarId_recipeId").on(
|
|
t.altarId,
|
|
t.recipeId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const CraftingRecipes = mysqlTable(
|
|
"crafting_recipes",
|
|
{
|
|
id: int("id").primaryKey().notNull(),
|
|
productName: varchar("product_name", { length: 64 }).unique().notNull(),
|
|
reward: int("reward").notNull(),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
achievement: varchar("achievement", { length: 255 }).notNull().default(""),
|
|
secret: varchar("secret", { length: 1 }).notNull().default("0"),
|
|
limited: varchar("limited", { length: 1 }).notNull().default("0"),
|
|
remaining: int("remaining").notNull().default(0),
|
|
},
|
|
(t) => [uniqueIndex("crafting_recipes_productName").on(t.productName)],
|
|
);
|
|
|
|
export const GiftWrappers = mysqlTable("gift_wrappers", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
spriteId: int("sprite_id").notNull(),
|
|
itemId: int("item_id").notNull(),
|
|
type: varchar("type", { length: 7 }).notNull().default("wrapper"),
|
|
});
|
|
|
|
export const GroupsItems = mysqlTable(
|
|
"groups_items",
|
|
{
|
|
type: varchar("type", { length: 6 }).notNull(),
|
|
id: int("id").notNull(),
|
|
firstvalue: varchar("firstvalue", { length: 255 }).notNull(),
|
|
secondvalue: varchar("secondvalue", { length: 2000 }).notNull(),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
},
|
|
(t) => [primaryKey({ columns: [t.id, t.type] })],
|
|
);
|
|
|
|
export const GuildForumViews = mysqlTable("guild_forum_views", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull(),
|
|
guildId: int("guild_id").notNull(),
|
|
timestamp: int("timestamp").notNull(),
|
|
});
|
|
|
|
export const GuildsElements = mysqlTable(
|
|
"guilds_elements",
|
|
{
|
|
id: int("id").notNull(),
|
|
firstvalue: varchar("firstvalue", { length: 300 }).notNull(),
|
|
secondvalue: varchar("secondvalue", { length: 300 }).notNull(),
|
|
type: varchar("type", { length: 50 }).notNull(),
|
|
enabled: varchar("enabled", { length: 1 }).notNull().default("1"),
|
|
},
|
|
(t) => [uniqueIndex("guilds_elements_id_type").on(t.id, t.type)],
|
|
);
|
|
|
|
export const HotelviewNews = mysqlTable("hotelview_news", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
title: varchar("title", { length: 100 }).notNull(),
|
|
text: varchar("text", { length: 500 }).notNull(),
|
|
buttonText: varchar("button_text", { length: 50 }).notNull(),
|
|
buttonType: varchar("button_type", { length: 6 }).notNull().default("web"),
|
|
buttonLink: varchar("button_link", { length: 200 }).notNull(),
|
|
image: varchar("image", { length: 200 }).notNull(),
|
|
});
|
|
|
|
export const ItemsCrackable = mysqlTable("items_crackable", {
|
|
itemId: int("item_id").primaryKey().notNull(),
|
|
itemName: varchar("item_name", { length: 255 }).notNull(),
|
|
count: int("count").notNull(),
|
|
prizes: varchar("prizes", { length: 860 }).notNull().default("179:1"),
|
|
achievementTick: varchar("achievement_tick", { length: 64 }).notNull(),
|
|
achievementCracked: varchar("achievement_cracked", { length: 64 }).notNull(),
|
|
requiredEffect: int("required_effect").notNull().default(0),
|
|
subscriptionDuration: int("subscription_duration"),
|
|
subscriptionType: varchar("subscription_type", { length: 255 }),
|
|
});
|
|
|
|
export const ItemsHighscoreData = mysqlTable("items_highscore_data", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
itemId: int("item_id").notNull(),
|
|
userIds: varchar("user_ids", { length: 500 }).notNull(),
|
|
score: int("score").notNull(),
|
|
isWin: tinyint("is_win").default(0),
|
|
timestamp: int("timestamp").notNull(),
|
|
});
|
|
|
|
export const LogsHcPayday = mysqlTable("logs_hc_payday", {
|
|
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
|
timestamp: int("timestamp", { unsigned: true }),
|
|
userId: int("user_id"),
|
|
hcStreak: int("hc_streak", { unsigned: true }),
|
|
totalCoinsSpent: int("total_coins_spent", { unsigned: true }),
|
|
rewardCoinsSpent: int("reward_coins_spent", { unsigned: true }),
|
|
rewardStreak: int("reward_streak", { unsigned: true }),
|
|
totalPayout: int("total_payout", { unsigned: true }),
|
|
currency: varchar("currency", { length: 255 }),
|
|
claimed: tinyint("claimed").default(0),
|
|
});
|
|
|
|
export const MessengerCategories = mysqlTable("messenger_categories", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
name: varchar("name", { length: 25 }).notNull(),
|
|
userId: int("user_id").notNull(),
|
|
});
|
|
|
|
export const NavigatorFilter = mysqlTable("navigator_filter", {
|
|
key: varchar("key", { length: 11 }).primaryKey().notNull(),
|
|
field: varchar("field", { length: 32 }).notNull(),
|
|
compare: varchar("compare", { length: 18 }).notNull(),
|
|
databaseQuery: varchar("database_query", { length: 1024 }).notNull(),
|
|
});
|
|
|
|
export const NuxGifts = mysqlTable("nux_gifts", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
type: varchar("type", { length: 4 }).notNull().default("item"),
|
|
value: varchar("value", { length: 32 }).notNull(),
|
|
image: varchar("image", { length: 256 }).notNull(),
|
|
});
|
|
|
|
export const OldGuildsForums = mysqlTable("old_guilds_forums", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
guildId: int("guild_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
subject: mediumtext("subject").notNull(),
|
|
message: longtext("message").notNull(),
|
|
state: varchar("state", { length: 15 }).notNull().default("OPEN"),
|
|
adminId: int("admin_id").notNull().default(0),
|
|
pinned: varchar("pinned", { length: 1 }).notNull().default("0"),
|
|
locked: varchar("locked", { length: 1 }).notNull().default("0"),
|
|
timestamp: int("timestamp").notNull(),
|
|
});
|
|
|
|
export const OldGuildsForumsComments = mysqlTable(
|
|
"old_guilds_forums_comments",
|
|
{
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
threadId: int("thread_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
timestamp: int("timestamp").notNull(),
|
|
message: longtext("message").notNull(),
|
|
state: varchar("state", { length: 15 }).notNull().default("OPEN"),
|
|
adminId: int("admin_id").notNull().default(0),
|
|
},
|
|
);
|
|
|
|
export const PetActions = mysqlTable("pet_actions", {
|
|
id: int("ID").autoincrement().primaryKey().notNull(),
|
|
petType: int("pet_type").notNull(),
|
|
petName: varchar("pet_name", { length: 32 }).notNull(),
|
|
offspringType: int("offspring_type").notNull().default(-1),
|
|
happyActions: varchar("happy_actions", { length: 100 }).notNull().default(""),
|
|
tiredActions: varchar("tired_actions", { length: 100 }).notNull().default(""),
|
|
randomActions: varchar("random_actions", { length: 100 })
|
|
.notNull()
|
|
.default(""),
|
|
canSwim: varchar("can_swim", { length: 1 }).default("0"),
|
|
});
|
|
|
|
export const PetBreeds = mysqlTable(
|
|
"pet_breeds",
|
|
{
|
|
race: int("race").notNull(),
|
|
colorOne: int("color_one").notNull(),
|
|
colorTwo: int("color_two").notNull(),
|
|
hasColorOne: varchar("has_color_one", { length: 1 }).notNull().default("0"),
|
|
hasColorTwo: varchar("has_color_two", { length: 1 }).notNull().default("0"),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("pet_breeds_race_colorOne_colorTwo_hasColorOne_hasColorTwo").on(
|
|
t.race,
|
|
t.colorOne,
|
|
t.colorTwo,
|
|
t.hasColorOne,
|
|
t.hasColorTwo,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const PetCommandsData = mysqlTable("pet_commands_data", {
|
|
commandId: int("command_id").primaryKey().notNull(),
|
|
text: varchar("text", { length: 15 }).notNull(),
|
|
requiredLevel: int("required_level").notNull(),
|
|
rewardXp: int("reward_xp").notNull().default(5),
|
|
costHappyness: int("cost_happyness").notNull().default(0),
|
|
costEnergy: int("cost_energy").notNull().default(0),
|
|
});
|
|
|
|
export const Polls = mysqlTable("polls", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
title: varchar("title", { length: 255 })
|
|
.notNull()
|
|
.default(
|
|
"Hey! We'd appreciate it if you could take some time to answer these questions. It will help improve our hotel.",
|
|
),
|
|
thanksMessage: varchar("thanks_message", { length: 255 }).notNull(),
|
|
rewardBadge: varchar("reward_badge", { length: 10 }).notNull().default(""),
|
|
});
|
|
|
|
export const PollsAnswers = mysqlTable(
|
|
"polls_answers",
|
|
{
|
|
pollId: int("poll_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
questionId: int("question_id").notNull(),
|
|
answer: varchar("answer", { length: 255 }).notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("polls_answers_pollId_userId_questionId").on(
|
|
t.pollId,
|
|
t.userId,
|
|
t.questionId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const PollsQuestions = mysqlTable("polls_questions", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
parentId: int("parent_id").notNull().default(0),
|
|
pollId: int("poll_id").notNull(),
|
|
order: int("order").notNull(),
|
|
question: varchar("question", { length: 255 }).notNull(),
|
|
type: int("type").notNull().default(2),
|
|
minSelections: int("min_selections").notNull().default(1),
|
|
options: varchar("options", { length: 255 }).notNull(),
|
|
});
|
|
|
|
export const RoomModels = mysqlTable("room_models", {
|
|
name: varchar("name", { length: 100 }).primaryKey().notNull(),
|
|
doorX: int("door_x").notNull(),
|
|
doorY: int("door_y").notNull(),
|
|
doorDir: int("door_dir").notNull().default(2),
|
|
heightmap: text("heightmap").notNull(),
|
|
publicItems: text("public_items").notNull(),
|
|
clubOnly: varchar("club_only", { length: 1 }).notNull().default("0"),
|
|
});
|
|
|
|
export const RoomTradeLogItems = mysqlTable(
|
|
"room_trade_log_items",
|
|
{
|
|
id: int("id").notNull(),
|
|
itemId: int("item_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("room_trade_log_items_id_itemId_userId").on(
|
|
t.id,
|
|
t.itemId,
|
|
t.userId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const RoomWordfilter = mysqlTable(
|
|
"room_wordfilter",
|
|
{
|
|
roomId: int("room_id").notNull(),
|
|
word: varchar("word", { length: 25 }).notNull(),
|
|
},
|
|
(t) => [uniqueIndex("room_wordfilter_roomId_word").on(t.roomId, t.word)],
|
|
);
|
|
|
|
export const SanctionLevels = mysqlTable("sanction_levels", {
|
|
level: int("level").primaryKey().notNull(),
|
|
type: varchar("type", { length: 5 }).notNull(),
|
|
hourLength: int("hour_length").notNull(),
|
|
probationDays: int("probation_days").notNull(),
|
|
});
|
|
|
|
export const Sanctions = mysqlTable("sanctions", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
habboId: int("habbo_id").notNull().default(0),
|
|
sanctionLevel: int("sanction_level").notNull().default(0),
|
|
probationTimestamp: int("probation_timestamp").notNull().default(0),
|
|
reason: varchar("reason", { length: 255 }).notNull().default(""),
|
|
tradeLockedUntil: int("trade_locked_until").notNull().default(0),
|
|
isMuted: tinyint("is_muted").notNull().default(0),
|
|
muteDuration: int("mute_duration").notNull().default(0),
|
|
});
|
|
|
|
export const SupportCfhCategories = mysqlTable("support_cfh_categories", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
nameInternal: varchar("name_internal", { length: 255 }),
|
|
nameExternal: varchar("name_external", { length: 255 }),
|
|
});
|
|
|
|
export const SupportCfhTopics = mysqlTable("support_cfh_topics", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
categoryId: int("category_id"),
|
|
nameInternal: varchar("name_internal", { length: 255 }),
|
|
nameExternal: varchar("name_external", { length: 255 }),
|
|
action: varchar("action", { length: 11 }).default("mods"),
|
|
ignoreTarget: varchar("ignore_target", { length: 1 }).notNull().default("0"),
|
|
autoReply: text("auto_reply"),
|
|
defaultSanction: int("default_sanction").notNull().default(0),
|
|
});
|
|
|
|
export const SupportIssueCategories = mysqlTable("support_issue_categories", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
name: varchar("name", { length: 255 }).notNull().default("PII"),
|
|
});
|
|
|
|
export const SupportIssuePresets = mysqlTable("support_issue_presets", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
category: int("category").notNull().default(1),
|
|
name: varchar("name", { length: 100 }).notNull().default(""),
|
|
message: varchar("message", { length: 300 }).notNull().default(""),
|
|
reminder: varchar("reminder", { length: 100 }).notNull(),
|
|
banFor: int("ban_for").notNull().default(0),
|
|
muteFor: int("mute_for").notNull().default(0),
|
|
});
|
|
|
|
export const SupportPresets = mysqlTable("support_presets", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
type: varchar("type", { length: 4 }).notNull().default("user"),
|
|
preset: varchar("preset", { length: 200 }).notNull(),
|
|
});
|
|
|
|
export const UsersAchievements = mysqlTable(
|
|
"users_achievements",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
achievementName: varchar("achievement_name", { length: 255 }).notNull(),
|
|
progress: int("progress").notNull().default(1),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("users_achievements_userId_achievementName").on(
|
|
t.userId,
|
|
t.achievementName,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const UsersAchievementsQueue = mysqlTable(
|
|
"users_achievements_queue",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
achievementId: int("achievement_id").notNull(),
|
|
amount: int("amount").notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("users_achievements_queue_userId_achievementId").on(
|
|
t.userId,
|
|
t.achievementId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const UsersClothing = mysqlTable(
|
|
"users_clothing",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
clothingId: int("clothing_id").notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("users_clothing_userId_clothingId").on(t.userId, t.clothingId),
|
|
],
|
|
);
|
|
|
|
export const UsersEffects = mysqlTable(
|
|
"users_effects",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
effect: int("effect").notNull(),
|
|
duration: int("duration").notNull().default(86400),
|
|
activationTimestamp: int("activation_timestamp").notNull().default(-1),
|
|
total: int("total").notNull().default(1),
|
|
},
|
|
(t) => [uniqueIndex("users_effects_userId_effect").on(t.userId, t.effect)],
|
|
);
|
|
|
|
export const UsersFavoriteRooms = mysqlTable(
|
|
"users_favorite_rooms",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
roomId: int("room_id").notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("users_favorite_rooms_userId_roomId").on(t.userId, t.roomId),
|
|
],
|
|
);
|
|
|
|
export const UsersPets = mysqlTable("users_pets", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull(),
|
|
roomId: int("room_id").notNull(),
|
|
name: varchar("name", { length: 15 }).notNull().default("User Pet"),
|
|
race: int("race").notNull(),
|
|
type: int("type").notNull(),
|
|
color: varchar("color", { length: 6 }).notNull(),
|
|
happyness: int("happyness").notNull().default(100),
|
|
experience: int("experience").notNull().default(0),
|
|
energy: int("energy").notNull().default(100),
|
|
hunger: int("hunger").notNull().default(0),
|
|
thirst: int("thirst").notNull().default(0),
|
|
respect: int("respect").notNull().default(0),
|
|
created: int("created").notNull(),
|
|
x: int("x").notNull().default(0),
|
|
y: int("y").notNull().default(0),
|
|
z: double("z").notNull().default(0),
|
|
rot: int("rot").notNull().default(0),
|
|
hairStyle: int("hair_style").notNull().default(-1),
|
|
hairColor: int("hair_color").notNull().default(0),
|
|
saddle: varchar("saddle", { length: 1 }).notNull().default("0"),
|
|
ride: varchar("ride", { length: 1 }).notNull().default("0"),
|
|
mpType: int("mp_type").notNull().default(0),
|
|
mpColor: int("mp_color").notNull().default(0),
|
|
mpNose: int("mp_nose").notNull().default(0),
|
|
mpNoseColor: tinyint("mp_nose_color").notNull().default(0),
|
|
mpEyes: int("mp_eyes").notNull().default(0),
|
|
mpEyesColor: tinyint("mp_eyes_color").notNull().default(0),
|
|
mpMouth: int("mp_mouth").notNull().default(0),
|
|
mpMouthColor: tinyint("mp_mouth_color").notNull().default(0),
|
|
mpDeathTimestamp: int("mp_death_timestamp").notNull().default(0),
|
|
mpBreedable: varchar("mp_breedable", { length: 1 }).notNull().default("0"),
|
|
mpAllowBreed: varchar("mp_allow_breed", { length: 1 }).notNull().default("0"),
|
|
gnomeData: varchar("gnome_data", { length: 80 }).notNull().default(""),
|
|
mpIsDead: tinyint("mp_is_dead").notNull().default(0),
|
|
saddleItemId: int("saddle_item_id"),
|
|
});
|
|
|
|
export const UsersRecipes = mysqlTable(
|
|
"users_recipes",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
recipe: int("recipe").notNull(),
|
|
},
|
|
(t) => [uniqueIndex("users_recipes_userId_recipe").on(t.userId, t.recipe)],
|
|
);
|
|
|
|
export const UsersSavedSearches = mysqlTable("users_saved_searches", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
searchCode: varchar("search_code", { length: 255 }).notNull(),
|
|
filter: varchar("filter", { length: 255 }),
|
|
userId: int("user_id").notNull(),
|
|
});
|
|
|
|
export const UsersSubscriptions = mysqlTable("users_subscriptions", {
|
|
id: int("id", { unsigned: true }).autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id"),
|
|
subscriptionType: varchar("subscription_type", { length: 255 }),
|
|
timestampStart: int("timestamp_start", { unsigned: true }),
|
|
duration: int("duration", { unsigned: true }),
|
|
active: tinyint("active").default(1),
|
|
});
|
|
|
|
export const UsersTargetOfferPurchases = mysqlTable(
|
|
"users_target_offer_purchases",
|
|
{
|
|
userId: int("user_id").notNull(),
|
|
offerId: int("offer_id").notNull(),
|
|
state: int("state").notNull().default(0),
|
|
amount: int("amount").notNull().default(0),
|
|
lastPurchase: int("last_purchase").notNull().default(0),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("users_target_offer_purchases_userId_offerId").on(
|
|
t.userId,
|
|
t.offerId,
|
|
),
|
|
],
|
|
);
|
|
|
|
export const UsersWardrobe = mysqlTable("users_wardrobe", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
userId: int("user_id").notNull().default(0),
|
|
slotId: int("slot_id").notNull().default(0),
|
|
look: varchar("look", { length: 256 }).notNull(),
|
|
gender: varchar("gender", { length: 1 }).notNull().default("F"),
|
|
});
|
|
|
|
export const VoucherHistory = mysqlTable("voucher_history", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
voucherId: int("voucher_id").notNull(),
|
|
userId: int("user_id").notNull(),
|
|
timestamp: int("timestamp").notNull(),
|
|
});
|
|
|
|
export const Vouchers = mysqlTable("vouchers", {
|
|
id: int("id").autoincrement().primaryKey().notNull(),
|
|
code: varchar("code", { length: 10 }).notNull(),
|
|
credits: int("credits").notNull().default(0),
|
|
points: int("points").notNull().default(0),
|
|
pointsType: int("points_type").notNull().default(0),
|
|
catalogItemId: int("catalog_item_id").notNull().default(0),
|
|
amount: int("amount").notNull().default(1),
|
|
limit: int("limit").notNull().default(-1),
|
|
});
|
|
|
|
export const YoutubePlaylists = mysqlTable(
|
|
"youtube_playlists",
|
|
{
|
|
itemId: int("item_id").notNull(),
|
|
playlistId: varchar("playlist_id", { length: 255 }).notNull(),
|
|
order: int("order").notNull(),
|
|
},
|
|
(t) => [
|
|
uniqueIndex("youtube_playlists_itemId_playlistId_order").on(
|
|
t.itemId,
|
|
t.playlistId,
|
|
t.order,
|
|
),
|
|
],
|
|
);
|