summaryrefslogtreecommitdiffstats
path: root/crates/auth/migrations/20250723100947_user.sql
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2025-07-25 17:33:47 +0200
committerrtkay123 <dev@kanjala.com>2025-07-25 17:33:47 +0200
commitcd528dbb7fb5d596b47178110a3dcef9af573c8d (patch)
tree4c47f024cc7afb0e52c66fcc3ac04ec4329571d1 /crates/auth/migrations/20250723100947_user.sql
parent521c4e32e63ec20094df128c17d24e8e1dcb17c0 (diff)
downloadsellershut-cd528dbb7fb5d596b47178110a3dcef9af573c8d.tar.bz2
sellershut-cd528dbb7fb5d596b47178110a3dcef9af573c8d.zip
feat(auth): jwt
Diffstat (limited to 'crates/auth/migrations/20250723100947_user.sql')
-rw-r--r--crates/auth/migrations/20250723100947_user.sql19
1 files changed, 15 insertions, 4 deletions
diff --git a/crates/auth/migrations/20250723100947_user.sql b/crates/auth/migrations/20250723100947_user.sql
index 440afc7..b5566fe 100644
--- a/crates/auth/migrations/20250723100947_user.sql
+++ b/crates/auth/migrations/20250723100947_user.sql
@@ -2,8 +2,19 @@
create table auth_user (
id uuid primary key,
email text unique not null,
- avatar text,
- description text,
- updated_at text,
- create_at timestamptz not null default now()
+ 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();