You've already forked AstralRinth
forked from didirus/AstralRinth
Move charges to DB + fix subscription recurring payments (#971)
* Move charges to DB + fix subscription recurring payments * Finish most + pyro integration * Finish billing * Run prepare * Fix intervals * Fix clippy * Remove unused test
This commit is contained in:
17
migrations/20240923163452_charges-fix.sql
Normal file
17
migrations/20240923163452_charges-fix.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE charges (
|
||||
id bigint PRIMARY KEY,
|
||||
user_id bigint REFERENCES users NOT NULL,
|
||||
price_id bigint REFERENCES products_prices NOT NULL,
|
||||
amount bigint NOT NULL,
|
||||
currency_code text NOT NULL,
|
||||
status varchar(255) NOT NULL,
|
||||
due timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||
last_attempt timestamptz NULL,
|
||||
charge_type text NOT NULL,
|
||||
subscription_id bigint NULL,
|
||||
subscription_interval text NULL
|
||||
);
|
||||
|
||||
ALTER TABLE users_subscriptions DROP COLUMN last_charge;
|
||||
ALTER TABLE users_subscriptions ADD COLUMN metadata jsonb NULL;
|
||||
ALTER TABLE users_subscriptions DROP COLUMN expires;
|
||||
Reference in New Issue
Block a user