Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE events (
- id uuid DEFAULT uuid_generate_v4() NOT NULL,
- sender_id uuid NOT NULL,
- recipient_id uuid NOT NULL,
- address character varying NOT NULL
- );
- CREATE TABLE accounts (
- id uuid DEFAULT uuid_generate_v4() NOT NULL,
- address character varying NOT NULL
- );
- CREATE TABLE accounts_sources (
- id uuid DEFAULT uuid_generate_v4() NOT NULL,
- source_id uuid NOT NULL,
- account_id uuid NOT NULL,
- );
- CREATE TABLE sources (
- id uuid DEFAULT uuid_generate_v4() NOT NULL,
- source_id uuid,
- );
- ALTER TABLE ONLY events
- ADD CONSTRAINT fk_rails_27b65ad5c4 FOREIGN KEY (sender_id) REFERENCES accounts(id);
- ALTER TABLE ONLY events
- ADD CONSTRAINT fk_rails_e3b3f6fd6c FOREIGN KEY (recipient_id) REFERENCES accounts(id);
- ALTER TABLE ONLY accounts_sources
- ADD CONSTRAINT fk_rails_3825abd5e3 FOREIGN KEY (source_id) REFERENCES sources(id);
- ALTER TABLE ONLY accounts_sources
- ADD CONSTRAINT fk_rails_d1c491b354 FOREIGN KEY (account_id) REFERENCES accounts(id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement