diff options
| author | rtkay123 <dev@kanjala.com> | 2026-02-02 18:21:48 +0200 |
|---|---|---|
| committer | rtkay123 <dev@kanjala.com> | 2026-02-02 18:21:48 +0200 |
| commit | cdcf6a4caa66095c07ef9d6d3ebc7c795a046e1e (patch) | |
| tree | daae5af9a68d610ad6fd7c2cc0f7e97a714be6a0 /migrations | |
| parent | 1f76530bc5001d9a9088f269db6c03cf287b67e6 (diff) | |
| download | sellershut-cdcf6a4caa66095c07ef9d6d3ebc7c795a046e1e.tar.bz2 sellershut-cdcf6a4caa66095c07ef9d6d3ebc7c795a046e1e.zip | |
chore: initial migrations
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/20260202155154_profile.sql | 15 | ||||
| -rw-r--r-- | migrations/20260202155202_account.sql | 9 | ||||
| -rw-r--r-- | migrations/20260202155207_session.sql | 6 | ||||
| -rw-r--r-- | migrations/20260202155213_follow.sql | 6 | ||||
| -rw-r--r-- | migrations/20260202155215_like.sql | 6 |
5 files changed, 42 insertions, 0 deletions
diff --git a/migrations/20260202155154_profile.sql b/migrations/20260202155154_profile.sql new file mode 100644 index 0000000..aeec618 --- /dev/null +++ b/migrations/20260202155154_profile.sql @@ -0,0 +1,15 @@ +create type actor_kind as enum ('application', 'group', 'organization', 'person', 'service'); + +create table profile ( + ap_id text primary key, + username varchar(15), + description varchar(255), + inbox text not null, + role actor_kind not null default 'person', + outbox text, + picture text, + public_key text not null, + private_key text, + created_at timestamptz not null default now(), + last_refreshed_at timestamptz not null default now() +) diff --git a/migrations/20260202155202_account.sql b/migrations/20260202155202_account.sql new file mode 100644 index 0000000..3d82c7f --- /dev/null +++ b/migrations/20260202155202_account.sql @@ -0,0 +1,9 @@ +create extension if not exists citext; + +create table account ( + provider_id text not null, + provider_user_id text not null, + email citext not null, + ap_id text not null references profile(ap_id) on delete cascade, + primary key (provider_id, provider_user_id) +) diff --git a/migrations/20260202155207_session.sql b/migrations/20260202155207_session.sql new file mode 100644 index 0000000..35df920 --- /dev/null +++ b/migrations/20260202155207_session.sql @@ -0,0 +1,6 @@ +create table session ( + id text primary key, + expires timestamptz, + ap_id text not null references profile(ap_id) on delete cascade, + session text not null +) diff --git a/migrations/20260202155213_follow.sql b/migrations/20260202155213_follow.sql new file mode 100644 index 0000000..384287f --- /dev/null +++ b/migrations/20260202155213_follow.sql @@ -0,0 +1,6 @@ +create table follow ( + follower_ap_id text not null references profile(ap_id) on delete cascade, + followee_ap_id text not null references profile(ap_id) on delete cascade, + followed_at timestamptz not null default now(), + primary key (follower_ap_id, followee_ap_id) +) diff --git a/migrations/20260202155215_like.sql b/migrations/20260202155215_like.sql new file mode 100644 index 0000000..07c4866 --- /dev/null +++ b/migrations/20260202155215_like.sql @@ -0,0 +1,6 @@ +create table liked ( + user_ap_id text not null references profile(ap_id) on delete cascade, + object_id text not null, + liked_at timestamptz not null default now(), + primary key (user_ap_id, object_id) +) |
