summaryrefslogtreecommitdiffstats
path: root/migrations/20250713161354_account.sql
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2025-07-17 14:00:40 +0200
committerrtkay123 <dev@kanjala.com>2025-07-17 14:00:40 +0200
commit69fe55ad54468948c13af520a498ed4aeac194ed (patch)
treec7db25aa7cf615480e9b386064f232d2bec6ccc3 /migrations/20250713161354_account.sql
parent5fdb24b6a2cef7964a049e789ed90f883221d657 (diff)
downloadsellershut-69fe55ad54468948c13af520a498ed4aeac194ed.tar.bz2
sellershut-69fe55ad54468948c13af520a498ed4aeac194ed.zip
chore: convert to workspace
Diffstat (limited to 'migrations/20250713161354_account.sql')
-rw-r--r--migrations/20250713161354_account.sql43
1 files changed, 0 insertions, 43 deletions
diff --git a/migrations/20250713161354_account.sql b/migrations/20250713161354_account.sql
deleted file mode 100644
index 1b967b8..0000000
--- a/migrations/20250713161354_account.sql
+++ /dev/null
@@ -1,43 +0,0 @@
-create table account (
- id uuid primary key,
- username varchar(30) not null,
- inbox text not null,
- outbox text,
- 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
-);
-
-create table following (
- id uuid primary key,
- follower text references account(ap_id) on delete cascade,
- followee text references account(ap_id) on delete cascade,
- created_at timestamptz not null default now(),
- constraint unique_following unique (follower, followee)
-);
-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();