This commit is contained in:
13
backend-go/infra/migrations/005_create_users_table.sql
Normal file
13
backend-go/infra/migrations/005_create_users_table.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- Migration 005: Create users table with UUID primary key
|
||||
-- This establishes a local user record for each Firebase-authenticated user.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
firebase_uid VARCHAR(128) NOT NULL UNIQUE,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
display_name VARCHAR(255),
|
||||
created_at TIMESTAMP DEFAULT NOW(),
|
||||
updated_at TIMESTAMP DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_users_firebase_uid ON users(firebase_uid);
|
||||
Reference in New Issue
Block a user