init code

This commit is contained in:
Dmitry Chumak
2025-05-27 19:22:55 +05:00
parent 2b39909fd1
commit b47e0d3445
11 changed files with 529 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id INTEGER NOT NULL REFERENCES users(id),
expires_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);