@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1create table {$NAMESPACE}_repository.repository_commitdata (
2 id int unsigned not null auto_increment primary key,
3 commitID int unsigned not null,
4 authorName varchar(255) not null,
5 commitMessage longblob not null,
6 unique key (commitID),
7 key (authorName(128))
8);
9
10ALTER TABLE {$NAMESPACE}_worker.worker_task drop priority;
11ALTER TABLE {$NAMESPACE}_worker.worker_task drop key leaseOwner;
12ALTER TABLE {$NAMESPACE}_worker.worker_task add key (leaseOwner(16));
13
14create table {$NAMESPACE}_repository.repository_path (
15 id int unsigned not null auto_increment primary key,
16 path varchar(128) binary not null,
17 unique key (path)
18);
19
20create table {$NAMESPACE}_repository.repository_pathchange (
21 repositoryID int unsigned NOT NULL,
22 pathID int unsigned NOT NULL,
23 commitID int unsigned NOT NULL,
24 targetPathID int unsigned,
25 targetCommitID int unsigned,
26 changeType int unsigned NOT NULL,
27 fileType int unsigned NOT NULL,
28 isDirect bool NOT NULL,
29 commitSequence int unsigned NOT NULL,
30 primary key (commitID, pathID),
31 key (repositoryID, pathID, commitSequence)
32);
33
34create table {$NAMESPACE}_repository.repository_filesystem (
35 repositoryID int unsigned not null,
36 parentID int unsigned not null,
37 svnCommit int unsigned not null,
38 pathID int unsigned not null,
39 existed bool not null,
40 fileType int unsigned not null,
41 primary key (repositoryID, parentID, svnCommit, pathID)
42);
43
44alter table {$NAMESPACE}_repository.repository_filesystem add key (repositoryID, svnCommit);
45
46truncate {$NAMESPACE}_repository.repository_commit;
47alter table {$NAMESPACE}_repository.repository_commit
48 change repositoryPHID repositoryID int unsigned not null;
49alter table {$NAMESPACE}_repository.repository_commit drop key repositoryPHID;
50alter table {$NAMESPACE}_repository.repository_commit add unique key
51 (repositoryID, commitIdentifier(16));
52alter table {$NAMESPACE}_repository.repository_commit add key
53 (repositoryID, epoch);
54
55alter table {$NAMESPACE}_repository.repository_filesystem
56 add key (repositoryID, pathID, svnCommit);