From e26d87f4fa18999c6bcfbcf32cfa85adab11acdd Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Sat, 26 Jul 2025 19:24:38 +0200 Subject: feat(auth): create user call --- crates/auth/migrations/20250723100947_user.sql | 20 -------------------- .../auth/migrations/20250723121223_oauth_account.sql | 7 ------- crates/auth/migrations/20250725160900_session.sql | 8 -------- crates/auth/migrations/20250725161014_token.sql | 9 --------- 4 files changed, 44 deletions(-) delete mode 100644 crates/auth/migrations/20250723100947_user.sql delete mode 100644 crates/auth/migrations/20250723121223_oauth_account.sql delete mode 100644 crates/auth/migrations/20250725160900_session.sql delete mode 100644 crates/auth/migrations/20250725161014_token.sql (limited to 'crates/auth/migrations') diff --git a/crates/auth/migrations/20250723100947_user.sql b/crates/auth/migrations/20250723100947_user.sql deleted file mode 100644 index b5566fe..0000000 --- a/crates/auth/migrations/20250723100947_user.sql +++ /dev/null @@ -1,20 +0,0 @@ --- Add migration script here -create table auth_user ( - id uuid primary key, - email text unique not null, - updated_at timestamptz not null default now(), - created_at timestamptz not null default now() -); - -create or replace function set_updated_at() -returns trigger as $$ -begin - new.updated_at := now(); - return new; -end; -$$ language plpgsql; - -create trigger trigger_set_updated_at -before update on auth_user -for each row -execute function set_updated_at(); diff --git a/crates/auth/migrations/20250723121223_oauth_account.sql b/crates/auth/migrations/20250723121223_oauth_account.sql deleted file mode 100644 index 826fbcc..0000000 --- a/crates/auth/migrations/20250723121223_oauth_account.sql +++ /dev/null @@ -1,7 +0,0 @@ -CREATE TABLE oauth_account ( - provider_id text not null, - provider_user_id text not null, - user_id uuid not null, - primary key (provider_id, provider_user_id), - foreign key (user_id) references auth_user(id) -); diff --git a/crates/auth/migrations/20250725160900_session.sql b/crates/auth/migrations/20250725160900_session.sql deleted file mode 100644 index c5e76dc..0000000 --- a/crates/auth/migrations/20250725160900_session.sql +++ /dev/null @@ -1,8 +0,0 @@ --- Add migration script here -create schema if not exists "tower_sessions"; - -create table "tower_sessions"."session" ( - id text primary key not null, - data bytea not null, - expiry_date timestamptz not null -); diff --git a/crates/auth/migrations/20250725161014_token.sql b/crates/auth/migrations/20250725161014_token.sql deleted file mode 100644 index 68f476c..0000000 --- a/crates/auth/migrations/20250725161014_token.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Add migration script here -create table token ( - user_id uuid not null, - token text not null, - session_id text not null, - primary key (user_id, session_id), - foreign key (session_id) references "tower_sessions"."session"(id) on delete cascade, - foreign key (user_id) references auth_user(id) on delete cascade -); -- cgit v1.2.3