-- Auth.js required tables for @auth/pg-adapter -- Run against your Supabase / local PG database CREATE TABLE IF NOT EXISTS users ( id UUID DEFAULT gen_random_uuid() PRIMARY KEY, name TEXT, email TEXT UNIQUE, "emailVerified" TIMESTAMPTZ, image TEXT ); CREATE TABLE IF NOT EXISTS accounts ( id UUID DEFAULT gen_random_uuid() PRIMARY KEY, "userId" UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, type TEXT NOT NULL, provider TEXT NOT NULL, "providerAccountId" TEXT NOT NULL, refresh_token TEXT, access_token TEXT, expires_at INTEGER, token_type TEXT, scope TEXT, id_token TEXT, session_state TEXT ); CREATE TABLE IF NOT EXISTS sessions ( id UUID DEFAULT gen_random_uuid() PRIMARY KEY, "sessionToken" TEXT NOT NULL UNIQUE, "userId" UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, expires TIMESTAMPTZ NOT NULL ); CREATE TABLE IF NOT EXISTS verification_token ( identifier TEXT NOT NULL, token TEXT NOT NULL UNIQUE, expires TIMESTAMPTZ NOT NULL, PRIMARY KEY (identifier, token) );