feat:mollie and footer
This commit is contained in:
17
packages/db/src/migrations/0006_mollie_migration.sql
Normal file
17
packages/db/src/migrations/0006_mollie_migration.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Migrate from Lemonsqueezy to Mollie
|
||||
-- Renames payment provider columns in registration and drinkkaart_topup tables.
|
||||
|
||||
-- registration table:
|
||||
-- lemonsqueezy_order_id -> mollie_payment_id
|
||||
-- lemonsqueezy_customer_id -> dropped (Mollie does not return a persistent
|
||||
-- customer ID for one-off payments)
|
||||
|
||||
ALTER TABLE registration RENAME COLUMN lemonsqueezy_order_id TO mollie_payment_id;
|
||||
ALTER TABLE registration DROP COLUMN lemonsqueezy_customer_id;
|
||||
|
||||
-- drinkkaart_topup table:
|
||||
-- lemonsqueezy_order_id -> mollie_payment_id
|
||||
-- lemonsqueezy_customer_id -> dropped
|
||||
|
||||
ALTER TABLE drinkkaart_topup RENAME COLUMN lemonsqueezy_order_id TO mollie_payment_id;
|
||||
ALTER TABLE drinkkaart_topup DROP COLUMN lemonsqueezy_customer_id;
|
||||
@@ -46,8 +46,7 @@ export const drinkkaartTopup = sqliteTable("drinkkaart_topup", {
|
||||
balanceBefore: integer("balance_before").notNull(),
|
||||
balanceAfter: integer("balance_after").notNull(),
|
||||
type: text("type", { enum: ["payment", "admin_credit"] }).notNull(),
|
||||
lemonsqueezyOrderId: text("lemonsqueezy_order_id").unique(), // nullable; only for type="payment"
|
||||
lemonsqueezyCustomerId: text("lemonsqueezy_customer_id"),
|
||||
molliePaymentId: text("mollie_payment_id").unique(), // nullable; only for type="payment"
|
||||
adminId: text("admin_id"), // nullable; only for type="admin_credit"
|
||||
reason: text("reason"),
|
||||
paidAt: integer("paid_at", { mode: "timestamp_ms" }).notNull(),
|
||||
|
||||
@@ -29,8 +29,7 @@ export const registration = sqliteTable(
|
||||
paymentStatus: text("payment_status").notNull().default("pending"),
|
||||
paymentAmount: integer("payment_amount").default(0),
|
||||
giftAmount: integer("gift_amount").default(0),
|
||||
lemonsqueezyOrderId: text("lemonsqueezy_order_id"),
|
||||
lemonsqueezyCustomerId: text("lemonsqueezy_customer_id"),
|
||||
molliePaymentId: text("mollie_payment_id"),
|
||||
paidAt: integer("paid_at", { mode: "timestamp_ms" }),
|
||||
// Set when the drinkCardValue has been credited to the user's drinkkaart.
|
||||
// Null means not yet credited (either unpaid, account doesn't exist yet, or
|
||||
@@ -50,6 +49,6 @@ export const registration = sqliteTable(
|
||||
index("registration_managementToken_idx").on(table.managementToken),
|
||||
index("registration_paymentStatus_idx").on(table.paymentStatus),
|
||||
index("registration_giftAmount_idx").on(table.giftAmount),
|
||||
index("registration_lemonsqueezyOrderId_idx").on(table.lemonsqueezyOrderId),
|
||||
index("registration_molliePaymentId_idx").on(table.molliePaymentId),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user