This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE "users" ( | |
"id" SERIAL PRIMARY KEY, | |
"username" TEXT UNIQUE NOT NULL, | |
"password" TEXT NOT NULL, | |
"picture" BYTEA, | |
"fullname" TEXT NOT NULL, | |
"address" TEXT NOT NULL | |
); | |
CREATE TABLE "products" ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE "gdpr_users" ( | |
"id" SERIAL PRIMARY KEY, | |
"fullname" TEXT NOT NULL, | |
"address" TEXT NOT NULL | |
); | |
CREATE TABLE "users" ( | |
"id" INT PRIMARY KEY REFERENCES "gdpr_users"("id"), | |
"username" TEXT UNIQUE NOT NULL, | |
"password" TEXT NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shop=# SELECT * FROM "gdpr_users"; | |
id | fullname | address | |
----+----------+---------------------------- | |
1 | Jane Doe | 123 Main St - Anytown, USA | |
2 | John Doe | 456 Main St - Anytown, USA | |
shop=# SELECT * FROM "users"; | |
id | username | password | picture | |
----+----------+-----------+--------- | |
1 | jane.doe | some_hash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shop=# SELECT * FROM "gdpr_users"; | |
id | fullname | address | |
----+----------+---------------------------- | |
1 | Jane Doe | 123 Main St - Anytown, USA | |
2 | John Doe | 456 Main St - Anytown, USA | |
shop=# SELECT * FROM "users"; | |
id | username | password | picture | |
----+----------+-----------+--------- | |
2 | john.doe | some_hash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shop=# SELECT * FROM "gdpr_users"; | |
id | fullname | address | |
----+----------+---------------------------- | |
2 | John Doe | 456 Main St - Anytown, USA | |
shop=# SELECT * FROM "users"; | |
id | username | password | picture | |
----+----------+-----------+--------- | |
2 | john.doe | some_hash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO "gdpr_users" ("id", "fullname", "address") | |
VALUES (1, 'Jane Doe', '123 Main St - Anytown, USA'), | |
(2, 'John Doe', '456 Main St - Anytown, USA'); | |
INSERT INTO "users" ("id", "username", "password", "picture") | |
VALUES (1, 'jane.doe', 'some_hash', NULL), | |
(2, 'john.doe', 'some_hash', NULL); | |
INSERT INTO "products" ("id", "name", "description", "price") | |
VALUES (1, 'Carrot', 'A bundle of fresh carrots', 2), |