Potion/internal/infrastructure/database/migrations/001_create_users_table.sql
Hayden Hargreaves 3c4710bb48 (SQL/MIGRATION): First DB migration. Created the users table.
Also, needed to update to using plural table names.
2025-06-14 00:02:04 -07:00

19 lines
436 B
PL/PgSQL

-- Author: Hayden Hargreaves (hhargreaves2006@gmail.com)
-- Desc: Create the users table in the database.
-- Date: 06/13/2025
BEGIN;
-- Create the users table
CREATE TABLE IF NOT EXISTS Users (
Id SERIAL PRIMARY KEY NOT NULL,
GoogleId TEXT UNIQUE NOT NULL,
Name VARCHAR(64) NOT NULL,
Email VARCHAR(128) UNIQUE NOT NULL,
ImageUrl TEXT,
GoogleRefreshToken TEXT,
Created TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
COMMIT;