Initial commit with basic DB layout

This commit is contained in:
2023-01-03 15:16:10 +01:00
commit a9e300ede2
16 changed files with 330 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
-- This file should undo anything in `up.sql`
DROP TABLE UserFollows;
DROP TABLE Users;

View File

@@ -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
);