gitshark

Clone repository

git clone https://gitshark.de/git/workaround/Gitshark.git
git clone git@gitshark.de:workaround/Gitshark.git

← Commits

♻️ (db): Fold the two follow migrations into a single V9

02e0df991e907b5b58ad96e4e8bee6f8900d545f · Miggi · 2026-07-08T17:30:15Z

Changes

3 files changed, +31 -22

DELETE src/main/resources/db/migration/V10__received_pushes.sql +0 -12
diff --git a/src/main/resources/db/migration/V10__received_pushes.sql b/src/main/resources/db/migration/V10__received_pushes.sql
deleted file mode 100644
index 5dd884b..0000000
--- a/src/main/resources/db/migration/V10__received_pushes.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- Follower-side feed: Push activities received from followed remote repositories.
--- remote_actor_id is the sending repository's actor id; rows are only stored while
--- at least one local user follows that actor.
1 -create table received_pushes
2 -(
3 - id uuid primary key,
4 - remote_actor_id text not null,
5 - activity_id text not null unique,
6 - summary text,
7 - target text,
8 - payload text not null,
9 - received_at timestamptz not null default now()
10 -);
11 -
12 -create index idx_received_pushes_actor on received_pushes (remote_actor_id, received_at);
ADD src/main/resources/db/migration/V9__federation_following.sql +31 -0
diff --git a/src/main/resources/db/migration/V9__federation_following.sql b/src/main/resources/db/migration/V9__federation_following.sql
new file mode 100644
index 0000000..d72b967
--- /dev/null
+++ b/src/main/resources/db/migration/V9__federation_following.sql
@@ -0,0 +1,31 @@
1 +-- Outbound federation following (issue #3).
2 +
3 +-- Outbound follows: a local user following a repository on a remote instance.
4 +-- follow_activity_id is the id of the Follow activity we sent; the inbound Accept
5 +-- references it to confirm the follow (state PENDING -> ACCEPTED).
6 +create table remote_follows
7 +(
8 + id uuid primary key,
9 + user_id uuid not null references users (id) on delete cascade,
10 + remote_actor_id text not null,
11 + follow_activity_id text not null unique,
12 + state varchar(16) not null default 'PENDING' check (state in ('PENDING', 'ACCEPTED')),
13 + created_at timestamptz not null default now(),
14 + unique (user_id, remote_actor_id)
15 +);
16 +
17 +-- Follower-side feed: Push activities received from followed remote repositories.
18 +-- remote_actor_id is the sending repository's actor id; rows are only stored while
19 +-- at least one local user follows that actor.
20 +create table received_pushes
21 +(
22 + id uuid primary key,
23 + remote_actor_id text not null,
24 + activity_id text not null unique,
25 + summary text,
26 + target text,
27 + payload text not null,
28 + received_at timestamptz not null default now()
29 +);
30 +
31 +create index idx_received_pushes_actor on received_pushes (remote_actor_id, received_at);
DELETE src/main/resources/db/migration/V9__remote_follows.sql +0 -10
diff --git a/src/main/resources/db/migration/V9__remote_follows.sql b/src/main/resources/db/migration/V9__remote_follows.sql
deleted file mode 100644
index cc2c17f..0000000
--- a/src/main/resources/db/migration/V9__remote_follows.sql
+++ /dev/null
@@ -1,13 +0,0 @@
--- Outbound follows: a local user following a repository on a remote instance.
--- follow_activity_id is the id of the Follow activity we sent; the inbound Accept
--- references it to confirm the follow (state PENDING -> ACCEPTED).
1 -create table remote_follows
2 -(
3 - id uuid primary key,
4 - user_id uuid not null references users (id) on delete cascade,
5 - remote_actor_id text not null,
6 - follow_activity_id text not null unique,
7 - state varchar(16) not null default 'PENDING' check (state in ('PENDING', 'ACCEPTED')),
8 - created_at timestamptz not null default now(),
9 - unique (user_id, remote_actor_id)
10 -);

Keyboard shortcuts

?Show this help
g hGo home
EscClose dialog