first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:31:06 +03:00
commit 6e06119135
30 changed files with 1232 additions and 0 deletions

19
migrations/initial.sql Normal file
View File

@@ -0,0 +1,19 @@
-- initial migration for users and refresh_tokens
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE IF NOT EXISTS users (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
email text NOT NULL UNIQUE,
hashed_password text,
provider text,
is_active boolean NOT NULL DEFAULT true,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE TABLE IF NOT EXISTS refresh_tokens (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
expires_at timestamptz NOT NULL
);