chore: 调整金额表示格式

This commit is contained in:
2026-01-09 10:02:38 +08:00
parent 96288da150
commit 8bb7544b3e
5 changed files with 19 additions and 6 deletions

View File

@@ -15,8 +15,8 @@ export const redPacketDraws = pgTable("red_packet_draws", {
userId: text("user_id").notNull(),
amount: numeric("amount", {
precision: 20,
scale: 10,
precision: 38,
scale: 8,
}).notNull(),
createdAt: timestamp("created_at", { withTimezone: true })

View File

@@ -21,10 +21,7 @@ export const redPackets = pgTable("red_packets", {
count: integer("count").notNull(),
currencyName: text("currency_name").notNull(),
currencyPrecision: numeric("currency_precision", {
precision: 20,
scale: 10,
}).notNull(),
currencyPrecision: integer("currency_precision").notNull(),
rule: jsonb("rule")
.$type<CreateRedPacketPayload["rule"]>()

View File

@@ -0,0 +1 @@
ALTER TABLE "red_packet_draws" ALTER COLUMN "amount" SET DATA TYPE numeric(38, 8);

View File

@@ -0,0 +1 @@
ALTER TABLE "red_packets" ALTER COLUMN "currency_precision" SET DATA TYPE integer;

View File

@@ -36,6 +36,20 @@
"when": 1767792389199,
"tag": "0004_overconfident_nova",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1767924016559,
"tag": "0005_quiet_leech",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1767924109495,
"tag": "0006_rare_maginty",
"breakpoints": true
}
]
}