mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-09-11 14:36:35 +03:00
* 🗃️ new table for invitations to subscribe to brain * ✨ new BrainSubscription class * ✨ new subscription router * 👽️ add RESEND_API_KEY to .env in BE * 📦 add 'resend' lib to requirements * ♻️ fix some stanGPT
19 lines
505 B
PL/PgSQL
19 lines
505 B
PL/PgSQL
BEGIN;
|
|
|
|
-- Create brain_subscription_invitations table if it doesn't exist
|
|
CREATE TABLE IF NOT EXISTS brain_subscription_invitations (
|
|
brain_id UUID,
|
|
email VARCHAR(255),
|
|
rights VARCHAR(255),
|
|
PRIMARY KEY (brain_id, email),
|
|
FOREIGN KEY (brain_id) REFERENCES Brains (brain_id)
|
|
);
|
|
|
|
INSERT INTO migrations (name)
|
|
SELECT '202307111517030_add_subscription_invitations_table'
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM migrations WHERE name = '202307111517030_add_subscription_invitations_table'
|
|
);
|
|
|
|
COMMIT;
|