Reconcile website_* schema to the live AtomCMS DB (amx_test)
Introspected the live DB and fixed real drift between the hand-modeled
schema and the actual columns:
- Added missing @map("snake_case") on camelCase fields that silently
failed at query time: website_teams (rank_name/hidden_rank/...),
website_paypal_transactions/user_guestbooks/help_center_tickets(+replies)/
used_shop_vouchers/maintenance_tasks (user_id), website_rare_values
(currency_type).
- website_permissions was modeled as key/value/comment but is actually
permission/min_rank/description — fixed the model + the admin page/action.
- website_shop_articles.icon -> icon_url (+ added category_id, is_giftable);
updated the shop page + admin shop CRUD.
- website_shop_categories: dropped non-existent slug/timestamps, added the
real description/order columns; updated the shop page.
- website_shop_article_features.features(Json) -> content(Text).
Verified against amx_test: all website_* query errors gone; home renders
the real hotel_name ("Habbo"), rankings shows real users, /staff + /shop
200. tsc 0, vitest 49/49, next build 0. Remaining missing tables
(radio_*/game_*/staff_activities/alert_logs/article_comments+reactions)
don't exist in this DB and degrade gracefully via try/catch.
This commit is contained in:
1 parent
4eccd146ba
commit
b97a88c561
6 files changed
+92
-93
No files matched your search
+27
-26
@@ -1645,12 +1645,12 @@ model WebsiteIpBlacklist {
|
||||
}
|
||||
|
||||
model WebsitePermissions {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
key String @unique @db.VarChar(255)
|
||||
value String? @db.VarChar(255)
|
||||
comment String? @db.VarChar(255)
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
permission String @unique @db.VarChar(255)
|
||||
minRank Int @map("min_rank")
|
||||
description String? @db.Text
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
|
||||
@@map("website_permissions")
|
||||
}
|
||||
@@ -1686,12 +1686,12 @@ model WebsiteBetaCodes {
|
||||
|
||||
model WebsiteTeams {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
rankName String @unique @db.VarChar(255)
|
||||
hiddenRank Boolean @default(false)
|
||||
rankName String @unique @map("rank_name") @db.VarChar(255)
|
||||
hiddenRank Boolean @default(false) @map("hidden_rank")
|
||||
badge String? @db.VarChar(255)
|
||||
jobDescription String? @db.VarChar(255)
|
||||
staffColor String @default("#327fa8") @db.VarChar(255)
|
||||
staffBackground String @default("staff-bg.png") @db.VarChar(255)
|
||||
jobDescription String? @map("job_description") @db.VarChar(255)
|
||||
staffColor String @default("#327fa8") @map("staff_color") @db.VarChar(255)
|
||||
staffBackground String @default("staff-bg.png") @map("staff_background") @db.VarChar(255)
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
|
||||
@@ -1750,7 +1750,7 @@ model WebsiteRareValues {
|
||||
name String @db.VarChar(255)
|
||||
creditValue String? @map("credit_value") @db.VarChar(255)
|
||||
currencyValue String? @map("currency_value") @db.VarChar(255)
|
||||
currencyType String @default("diamonds") @db.VarChar(255)
|
||||
currencyType String @default("diamonds") @map("currency_type") @db.VarChar(255)
|
||||
furnitureIcon String @map("furniture_icon") @db.VarChar(255)
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
@@ -1809,7 +1809,7 @@ model WebsiteHelpCenterCategories {
|
||||
|
||||
model WebsiteHelpCenterTickets {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
userId Int?
|
||||
userId Int? @map("user_id")
|
||||
categoryId BigInt? @map("category_id") @db.UnsignedBigInt
|
||||
title String @db.VarChar(255)
|
||||
content String @db.Text
|
||||
@@ -1822,7 +1822,7 @@ model WebsiteHelpCenterTickets {
|
||||
|
||||
model WebsitePaypalTransactions {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
userId Int
|
||||
userId Int @map("user_id")
|
||||
transactionId String @map("transaction_id") @db.VarChar(255)
|
||||
status String? @db.VarChar(255)
|
||||
description String? @map("description") @db.VarChar(512)
|
||||
@@ -1836,12 +1836,14 @@ model WebsitePaypalTransactions {
|
||||
|
||||
model WebsiteShopArticles {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
categoryId BigInt? @map("website_shop_category_id") @db.UnsignedBigInt
|
||||
name String @unique @db.VarChar(255)
|
||||
info String @db.VarChar(255)
|
||||
icon String @db.VarChar(255)
|
||||
iconUrl String @map("icon_url") @db.VarChar(255)
|
||||
color String @db.VarChar(255)
|
||||
costs Int @db.UnsignedInt
|
||||
giveRank Int? @map("give_rank")
|
||||
isGiftable Boolean @default(false) @map("is_giftable")
|
||||
credits Int? @db.UnsignedInt
|
||||
duckets Int? @db.UnsignedInt
|
||||
diamonds Int? @db.UnsignedInt
|
||||
@@ -1869,7 +1871,7 @@ model WebsiteShopVouchers {
|
||||
|
||||
model WebsiteUsedShopVouchers {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
userId Int
|
||||
userId Int @map("user_id")
|
||||
voucherId BigInt @map("voucher_id") @db.UnsignedBigInt
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
@@ -1880,7 +1882,7 @@ model WebsiteUsedShopVouchers {
|
||||
model WebsiteShopArticleFeatures {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
articleId BigInt @map("article_id") @db.UnsignedBigInt
|
||||
features Json
|
||||
content String @db.Text
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
|
||||
@@ -1890,7 +1892,7 @@ model WebsiteShopArticleFeatures {
|
||||
model WebsiteHelpCenterTicketReplies {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
ticketId BigInt @map("ticket_id") @db.UnsignedBigInt
|
||||
userId Int
|
||||
userId Int @map("user_id")
|
||||
content String @db.Text
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
@@ -1917,7 +1919,7 @@ model AlertLogs {
|
||||
model WebsiteUserGuestbooks {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
profileId Int @map("profile_id")
|
||||
userId Int
|
||||
userId Int @map("user_id")
|
||||
message String @db.VarChar(255)
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
@@ -1926,19 +1928,18 @@ model WebsiteUserGuestbooks {
|
||||
}
|
||||
|
||||
model WebsiteShopCategories {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
name String @db.VarChar(255)
|
||||
slug String @unique @db.VarChar(255)
|
||||
icon String? @db.VarChar(255)
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
name String @db.VarChar(255)
|
||||
description String? @db.Text
|
||||
icon String? @db.VarChar(255)
|
||||
order Int @default(0)
|
||||
|
||||
@@map("website_shop_categories")
|
||||
}
|
||||
|
||||
model WebsiteMaintenanceTasks {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
userId Int?
|
||||
userId Int? @map("user_id")
|
||||
task String @db.VarChar(255)
|
||||
completed Boolean @default(false)
|
||||
createdAt DateTime? @map("created_at") @db.Timestamp(0)
|
||||
|
||||
Reference in new issue
Block a user