summaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2025-07-16 08:55:14 +0200
committerrtkay123 <dev@kanjala.com>2025-07-16 08:55:14 +0200
commitda6ab098acacf6233542a591110f8b28ffd298ed (patch)
tree2738d9854dd2fba6c51e10ab11106671115d57d0 /migrations
parent61bf8e1eafca875939b8004469903f3833092266 (diff)
downloadsellershut-da6ab098acacf6233542a591110f8b28ffd298ed.tar.bz2
sellershut-da6ab098acacf6233542a591110f8b28ffd298ed.zip
build: update tbl
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20250713161354_account.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/migrations/20250713161354_account.sql b/migrations/20250713161354_account.sql
index 367cc7b..1b967b8 100644
--- a/migrations/20250713161354_account.sql
+++ b/migrations/20250713161354_account.sql
@@ -6,6 +6,13 @@ create table account (
local boolean not null,
ap_id text not null unique,
private_key text,
+ avatar_url text,
+ description text,
+ user_type text not null check (
+ user_type IN ('PERSON', 'APPLICATION', 'GROUP', 'ORGANIZATION', 'SERVICE')
+ ),
+ created_at timestamptz not null default now(),
+ updated_at timestamptz not null default now(),
public_key text not null
);
@@ -21,3 +28,16 @@ create index "following_pagination" on "following" ("created_at" asc);
create unique index unique_username_local
on account (username)
where local = true;
+
+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 account
+for each row
+execute function set_updated_at();