Initial commit with basic DB layout

This commit is contained in:
phundrak committed 2023-01-03 15:16:10 +01:00
commit a9e300ede2
16 files changed
+330

No files matched your search

@@ -0,0 +1,3 @@
-- This file should undo anything in `up.sql`
DROP TABLE UserFollows;
DROP TABLE Users;
@@ -0,0 +1,20 @@
-- Your SQL goes here
CREATE TABLE Users (
id VARCHAR(31) PRIMARY KEY, -- Appwrite User ID
username VARCHAR(64) NOT NULL
);
CREATE TABLE UserFollows (
id SERIAL PRIMARY KEY,
follower VARCHAR(31)
REFERENCES Users(id)
ON UPDATE CASCADE
ON DELETE CASCADE
NOT NULL,
following VARCHAR(31)
REFERENCES Users(id)
ON UPDATE CASCADE
ON DELETE CASCADE
NOT NULL
);