Path: blob/master/resources/sql/patches/006.repository.sql
12250 views
create table {$NAMESPACE}_repository.repository_commitdata (1id int unsigned not null auto_increment primary key,2commitID int unsigned not null,3authorName varchar(255) not null,4commitMessage longblob not null,5unique key (commitID),6key (authorName(128))7);89ALTER TABLE {$NAMESPACE}_worker.worker_task drop priority;10ALTER TABLE {$NAMESPACE}_worker.worker_task drop key leaseOwner;11ALTER TABLE {$NAMESPACE}_worker.worker_task add key (leaseOwner(16));1213create table {$NAMESPACE}_repository.repository_path (14id int unsigned not null auto_increment primary key,15path varchar(128) binary not null,16unique key (path)17);1819create table {$NAMESPACE}_repository.repository_pathchange (20repositoryID int unsigned NOT NULL,21pathID int unsigned NOT NULL,22commitID int unsigned NOT NULL,23targetPathID int unsigned,24targetCommitID int unsigned,25changeType int unsigned NOT NULL,26fileType int unsigned NOT NULL,27isDirect bool NOT NULL,28commitSequence int unsigned NOT NULL,29primary key (commitID, pathID),30key (repositoryID, pathID, commitSequence)31);3233create table {$NAMESPACE}_repository.repository_filesystem (34repositoryID int unsigned not null,35parentID int unsigned not null,36svnCommit int unsigned not null,37pathID int unsigned not null,38existed bool not null,39fileType int unsigned not null,40primary key (repositoryID, parentID, svnCommit, pathID)41);4243alter table {$NAMESPACE}_repository.repository_filesystem add key (repositoryID, svnCommit);4445truncate {$NAMESPACE}_repository.repository_commit;46alter table {$NAMESPACE}_repository.repository_commit47change repositoryPHID repositoryID int unsigned not null;48alter table {$NAMESPACE}_repository.repository_commit drop key repositoryPHID;49alter table {$NAMESPACE}_repository.repository_commit add unique key50(repositoryID, commitIdentifier(16));51alter table {$NAMESPACE}_repository.repository_commit add key52(repositoryID, epoch);5354alter table {$NAMESPACE}_repository.repository_filesystem55add key (repositoryID, pathID, svnCommit);565758