chore(db): 新增 CSV 历史汇率播种脚本及表唯一约束

This commit is contained in:
2026-05-02 23:16:25 +08:00
parent 189266c5e3
commit d7f8a338b6
4 changed files with 118 additions and 1 deletions
+3 -1
View File
@@ -105,4 +105,6 @@ export const exchangeRatesHistory = pgTable("exchange_rates_history", {
createdAt: timestamp("created_at", { withTimezone: true, mode: "date" })
.defaultNow()
.notNull(),
});
}, (table) => ({
unq: unique("rate_time_unq").on(table.fromCurrency, table.toCurrency, table.fetchTime),
}));