Skip to content

Commit 42c47ab

Browse files
committed
Skirt keyword "user". This can work later...
1 parent a18ad82 commit 42c47ab

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

fb/data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INSERT INTO "user" (id, full_name) VALUES
1+
INSERT INTO consumer (id, full_name) VALUES
22
('606fa027-a577-4018-952e-3c8469372829', 'Curly'),
33
('f3411edc-e1d0-452a-bc19-b42c0d5a0e36', 'Larry'),
44
('05ed1b59-090e-40af-8f0e-68a1129b55b4', 'Mo');

fb/schema.sql

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
BEGIN;
2+
3+
DROP SCHEMA IF EXISTS fb CASCADE;
14
CREATE SCHEMA fb;
25
SET search_path TO fb,"$user",public;
36
CREATE EXTENSION "uuid-ossp";
47

58

6-
CREATE TABLE "user" (
9+
CREATE TABLE consumer (
710
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
811
created timestamptz NOT NULL DEFAULT now(),
912
full_name text NOT NULL DEFAULT ''
@@ -14,13 +17,13 @@ CREATE TABLE post (
1417
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
1518
created timestamptz NOT NULL DEFAULT now(),
1619
content text NOT NULL DEFAULT '',
17-
"user" uuid REFERENCES "user" NOT NULL
20+
consumer uuid REFERENCES consumer NOT NULL
1821
);
1922

2023

2124
CREATE TABLE friendship (
22-
first uuid REFERENCES "user" NOT NULL,
23-
second uuid REFERENCES "user" NOT NULL,
25+
first uuid REFERENCES consumer NOT NULL,
26+
second uuid REFERENCES consumer NOT NULL,
2427
created timestamptz NOT NULL DEFAULT now(),
2528
UNIQUE (first, second)
2629
);
@@ -44,3 +47,5 @@ AFTER INSERT ON friendship
4447
DEFERRABLE INITIALLY DEFERRED
4548
FOR EACH ROW
4649
EXECUTE PROCEDURE check_friendship_symmetry();
50+
51+
END;

0 commit comments

Comments
 (0)