aboutsummaryrefslogtreecommitdiffstats
path: root/ops/id-unification.md
blob: 4e08e1a37e74e8ea30b1246696eb173b80b6c31e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
title: ID unification migration plan
---

**DRAFT**

A coming update to SourceHut's internal design calls for the values of the ID
columns in our databases to be made uniform. Each database (e.g. for git, hg,
builds, etc) maintained its own copy of tables with shared information, sourcing
updates from meta.sr.ht via webhooks, but each of these rows had an ID specific
to each database. This change will make these IDs uniform across all services in
preparation for linking our services more tightly together through GraphQL
Federation.

This document outlines the extra steps required to perform this upgrade for
third-party instances.

## Upgrade process

For meta.sr.ht:

1. Disable automatic migrations
1. Upgrade meta.sr.ht, restart the services, and ensure that the meta.sr.ht
   GraphQL API is online
1. Re-enable automatic migrations if desired

Then, for each service, one at a time:

1. Disable automatic migrations
1. Shut off the service
1. Run upgrades
1. Run `$service-migrate upgrade head` (e.g. gitsrht-migrate) for each service
   and monitor the migration progress
1. Turn on the service
1. Re-enable automatic migrations if desired

## Downgrade process

1. Disable automatic migrations
1. Downgrade meta.sr.ht and restart the services

Then, for each service, one at a time:

1. Shut off the service
1. Downgrade the software
1. Run `$service-migrate downgrade $version`, selecting $version from the list
   below, for each service
1. Turn on the service
1. Re-enable automatic migrations if desired

## Affected database schema revisions

Last schema revision prior to this change, for reference if downgrading:

- builds.sr.ht: *TODO*
- git.sr.ht: *TODO*
- hg.sr.ht: *TODO*
- hub.sr.ht: *TODO*
- lists.sr.ht: *TODO*
- man.sr.ht: *TODO*
- pages.sr.ht: *TODO*
- todo.sr.ht: *TODO*