repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

pico / sql
Eric Bower · 19 Feb 24

pico_plus_user.sql

 1-- find user id
 2SELECT id FROM app_users WHERE name = '{user}';
 3
 4-- add payment record
 5-- amount should be multiplied by 1 million and then later divded by the same
 6-- https://stackoverflow.com/a/51238749
 7INSERT INTO payment_history (user_id, payment_type, amount, data)
 8VALUES ('', 'stripe', 20 * 1000000, '{"notes": "", "tx_id":""}'::jsonb) RETURNING id;
 9
10-- enable pico+ features
11
12-- pgs
13-- storage max is 10gb
14-- file max is 50mb
15INSERT INTO feature_flags (user_id, name, data, expires_at)
16VALUES ('', 'pgs', '{"storage_max":10000000000, "file_max":50000000}'::jsonb, now() + '1 year'::interval);
17
18-- imgs
19-- storage max is 2gb
20INSERT INTO feature_flags (user_id, name, data, expires_at)
21VALUES ('', 'imgs', '{"storage_max":2000000000}'::jsonb, now() + '1 year'::interval);
22
23-- prose
24-- storage max is 1gb
25-- file max is 50mb
26INSERT INTO feature_flags (user_id, name, data, expires_at)
27VALUES ('', 'prose', '{"storage_max":1000000000, "file_max":50000000}'::jsonb, now() + '1 year'::interval);
28
29-- tuns
30INSERT INTO feature_flags (user_id, name, expires_at)
31VALUES ('', 'tuns', now() + '1 year'::interval);