2
-- This will DESTROY your database and create a fresh one
9
- re-evalutate some of the "text" field types, they might need to be "bytea"
10
unless we can guarantee utf-8
11
- re-evaluate the relationship table names, see if there isn't a better name for each of them
12
- add sample data for the schemas
13
- make sure names are only [a-z][0-9][-.+] and can only start with [a-z]
14
- present the database as a set of Interfaces
19
- rename soyuz.sql to launchpad.sql
20
- make Schema.extensible DEFAULT false (thanks spiv)
22
- add a manifest to Sourcepackage and Product, for the mutable HEAD manifest
23
- add a manifest to CodeRelease
24
- rename includeas to entrytype in ManifestEntry
25
- remove "part" from ManifestEntry
26
- add hints in Manifest table so sourcerer knows how to name patch branches
27
- fix my brain dead constraints for mutual exlcusivity on branch/changeset specs
28
- for a ManifestEntry, branch AND changeset can now both be null, to allow for Scott's virtual entries
29
- add the Packaging table to indicate the relationship between a Product and a Sourcepackage
31
- make Schema and Label have name, title, description
32
- added filenames for UpstreamreleaseFile, SourcepackageFile and BinarypackageBuildFile
33
- linked BinarypackageBuild to DistroRelease instead of DistroArchRelease
34
- add the Country table for a list of countries
35
- add the SpokenIn table to link countries and languages
36
- rename TranslationProject to TranslationEffort
37
- add iscurrent (boolean) field to the POTFiles table, current POTFiles
38
will be displayed in project summary pages.
39
- add ChangesetFile, ChangesetFilename and ChangesetFileHash tables
40
- rename Release to CodeRelease (and all dependent tables)
41
- refactor Processor and ProcessorFamily:
42
- the distroarchrelease now has a processorfamily field
43
- the binarypackagebuild (deb) now records its processor
44
- refactor the allocation of binarypackagebuild's (debs) to distroarchrelease's
45
- create a new table BinarypackageUpload that stores the packagearchivestatus
46
- remove that status from the BinarypackageBuild table
47
- refactor sourcepackage upload status
48
- move changes and urgency to sourcepackagerelease
49
- add builddependsindep so sourcepackagerelease
52
- remove Translation_POTFile_Relationship
53
- ...and replace with a "project" field in POTFile
54
- add a commenttext field to the POTMsgIDSighting table so we can track comments in POT files too
58
- first versioned release
64
DROP TABLE SpokenIn CASCADE;
65
DROP TABLE Country CASCADE;
66
DROP TABLE BugMessageSighting CASCADE;
67
DROP TABLE TranslationEffort_POTFile_Relationship CASCADE;
68
DROP TABLE POComment CASCADE;
69
DROP TABLE Branch_Relationship CASCADE;
70
DROP TABLE BugSystem CASCADE;
71
DROP TABLE BugWatch CASCADE;
72
DROP TABLE RosettaPOTranslationSighting CASCADE;
73
DROP TABLE BugAttachment CASCADE;
74
DROP TABLE BugAttachment_Relationship CASCADE;
75
DROP TABLE License CASCADE;
76
DROP TABLE Bug_Relationship CASCADE;
77
DROP TABLE BugMessage CASCADE;
78
DROP TABLE POTranslationSighting CASCADE;
79
DROP TABLE BugRef CASCADE;
80
DROP TABLE Bug CASCADE;
81
DROP TABLE Packaging CASCADE;
82
DROP TABLE SourcepackageReleaseFile CASCADE;
83
DROP TABLE Sourcepackage_Relationship CASCADE;
84
DROP TABLE SourcepackageRelease CASCADE;
85
DROP TABLE CodeReleaseBugStatus CASCADE;
86
DROP TABLE SourcepackageLabel CASCADE;
87
DROP TABLE SourcepackageBugStatus CASCADE;
88
DROP TABLE Bug_Sourcepackage_Relationship CASCADE;
89
DROP TABLE SourcepackageUpload CASCADE;
90
DROP TABLE Sourcepackage CASCADE;
91
DROP TABLE BinarypackageBuildFile CASCADE;
92
DROP TABLE BinarypackageUpload CASCADE;
93
DROP TABLE BinarypackageBuild CASCADE;
94
DROP TABLE Binarypackage CASCADE;
95
DROP TABLE ProductBugStatus CASCADE;
96
DROP TABLE Branch CASCADE;
97
DROP TABLE ArchConfig CASCADE;
98
DROP TABLE ArchConfigEntry CASCADE;
99
DROP TABLE BugActivity CASCADE;
100
DROP TABLE ArchArchiveLocation CASCADE;
101
DROP TABLE POTranslation CASCADE;
102
DROP TABLE BugSystemType CASCADE;
103
DROP TABLE POTSubscription CASCADE;
104
DROP TABLE ChangesetFileHash CASCADE;
105
DROP TABLE ChangesetFile CASCADE;
106
DROP TABLE ChangesetFileName CASCADE;
107
DROP TABLE Changeset CASCADE;
108
DROP TABLE ArchArchive CASCADE;
109
DROP TABLE UpstreamReleaseFile CASCADE;
110
DROP TABLE UpstreamRelease CASCADE;
111
DROP TABLE CodeRelease CASCADE;
112
DROP TABLE CodeRelease_Relationship CASCADE;
113
DROP TABLE POTInheritance CASCADE;
114
DROP TABLE POTMsgIDSighting CASCADE;
115
DROP TABLE Manifest CASCADE;
116
DROP TABLE ProductLabel CASCADE;
117
DROP TABLE Product CASCADE;
118
DROP TABLE POFile CASCADE;
119
DROP TABLE POTFile CASCADE;
120
DROP TABLE Project_Relationship;
121
DROP TABLE POMsgID CASCADE;
122
DROP TABLE Language CASCADE;
123
DROP TABLE BugLabel CASCADE;
124
DROP TABLE TranslationEffort CASCADE;
125
DROP TABLE Project CASCADE;
126
DROP TABLE Project_TranslationEffort_Relationship CASCADE;
127
DROP TABLE Person CASCADE;
128
DROP TABLE EmailAddress CASCADE;
129
DROP TABLE TranslationFilter CASCADE;
130
DROP TABLE BranchLabel CASCADE;
131
DROP TABLE ManifestEntry CASCADE;
132
DROP TABLE GPGKey CASCADE;
133
DROP TABLE ArchUserID CASCADE;
134
DROP TABLE Membership CASCADE;
135
DROP TABLE WikiName CASCADE;
136
DROP TABLE JabberID CASCADE;
137
DROP TABLE IRCID CASCADE;
138
DROP TABLE PersonLabel CASCADE;
139
DROP TABLE TeamParticipation CASCADE;
140
DROP TABLE Schema CASCADE;
141
DROP TABLE Label CASCADE;
142
DROP TABLE Distribution CASCADE;
143
DROP TABLE DistroRelease CASCADE;
144
DROP TABLE DistroArchRelease CASCADE;
145
DROP TABLE ProcessorFamily CASCADE;
146
DROP TABLE Builder CASCADE;
147
DROP TABLE Processor CASCADE;
148
DROP TABLE SoyuzFileHash CASCADE;
149
DROP TABLE SoyuzFile CASCADE;
150
DROP TABLE OSFileInPackage CASCADE;
157
This is a person in the Soyuz system. A Person can also be a
158
team if the teamowner is not NULL. Note that we will create a
159
Person entry whenever we see an email address we didn't know
160
about, or a GPG key we didn't know about... and if we later
161
link that to a real Soyuz person we will update all the tables
162
that refer to that temporary person.
164
A Person is one of these automatically created people if it
165
has a NULL password and is not a team.
167
It's created first so that a Schema can have an owner, we'll
168
then define Schemas and Labels a bit later.
170
CREATE TABLE Person (
171
person serial PRIMARY KEY,
172
presentationname text,
176
teamowner integer REFERENCES Person,
177
teamdescription text,
179
karmatimestamp timestamp
182
INSERT INTO Person ( presentationname, givenname, familyname ) VALUES ( 'Mark Shuttleworth', 'Mark', 'Shuttleworth' ); -- 1
183
INSERT INTO Person ( presentationname, givenname, familyname ) VALUES ( 'Dave Miller', 'David', 'Miller' ); -- 2
184
INSERT INTO Person ( presentationname, givenname, familyname ) VALUES ( 'Colin Watson', 'Colin', 'Watson' ); -- 3
185
INSERT INTO Person ( presentationname, givenname, familyname ) VALUES ( 'Steve Alexander', 'Steve', 'Alexander' ); -- 4
186
INSERT INTO Person ( presentationname, givenname, familyname ) VALUES ( 'Scott James Remnant', 'Scott James', 'Remnant' ); -- 5
187
INSERT INTO Person ( presentationname, givenname, familyname ) VALUES ( 'Robert Collins', 'Robert', 'Collins' ); -- 6
191
REVELATION. THE SOYUZ METADATA
197
This is the (finger finger) "metadata" (finger finger)
198
which makes us... muahaha... distinctive... muahaha,
199
muahahaha, muahahahahahaa....
201
And yes, I'm not yet sure if my database model for this
202
is on crack. Comments please. MS 24/06/04
204
CREATE TABLE Schema (
205
schema serial PRIMARY KEY,
208
description text NOT NULL,
209
owner integer NOT NULL REFERENCES Person,
210
extensible boolean NOT NULL DEFAULT false
217
The set of labels in all schemas
220
label serial PRIMARY KEY,
221
schema integer NOT NULL REFERENCES Schema,
224
description text NOT NULL
232
A table of email addresses for Soyuz people.
234
CREATE TABLE EmailAddress (
235
emailid serial PRIMARY KEY,
236
email text NOT NULL UNIQUE,
237
person integer NOT NULL REFERENCES Person,
238
label integer NOT NULL REFERENCES Label
245
A table of GPGKeys, mapping them to Soyuz users.
247
CREATE TABLE GPGKey (
248
gpgkey serial PRIMARY KEY,
249
person integer NOT NULL REFERENCES Person,
250
keyid text NOT NULL UNIQUE,
251
fingerprint text NOT NULL UNIQUE,
252
pubkey text NOT NULL,
253
revoked boolean NOT NULL
260
A table of Arch user id's
262
CREATE TABLE ArchUserID (
263
person integer NOT NULL REFERENCES Person,
264
archuserid text NOT NULL UNIQUE
271
The identity a person uses on one of the Soyuz wiki's.
273
CREATE TABLE WikiName (
274
person integer NOT NULL REFERENCES Person,
276
wikiname text NOT NULL,
277
UNIQUE ( wiki, wikiname )
284
A person's Jabber ID on our network.
286
CREATE TABLE JabberID (
287
person integer NOT NULL REFERENCES Person,
288
jabberid text NOT NULL UNIQUE
295
A person's irc nick's.
298
person integer NOT NULL REFERENCES Person,
299
network text NOT NULL,
300
nickname text NOT NULL
308
A neat way to attache tags to people...
310
CREATE TABLE PersonLabel (
311
person integer NOT NULL REFERENCES Person,
312
label integer NOT NULL REFERENCES Label
319
A table of memberships. It's only valid to have a membership
320
in a team, not a non-team person.
322
CREATE TABLE Membership (
323
person integer NOT NULL REFERENCES Person,
324
team integer NOT NULL REFERENCES Person,
325
label integer NOT NULL REFERENCES Label,
326
status integer NOT NULL REFERENCES Label,
327
PRIMARY KEY ( person, team )
334
This is a table which shows all the memberships
335
of a person. Effectively it collapses team hierarchies
336
and flattens them to a straight team-person relation.
337
People are also members of themselves. This allows
338
us to query against a person entry elsewhere in Soyuz
339
and quickly find the things a person is an owner of.
341
CREATE TABLE TeamParticipation (
342
team integer NOT NULL REFERENCES Person,
343
person integer NOT NULL REFERENCES Person,
344
PRIMARY KEY ( team, person )
350
BUTTRESS. THE ARCH REPOSITORY.
351
This is the Soyuz subsystem that handles the storing and
352
cataloguing of all of our Arch branches.
359
A table of all known Arch Archives.
361
CREATE TABLE ArchArchive (
362
archive serial PRIMARY KEY,
365
description text NOT NULL,
366
visible boolean NOT NULL,
367
owner integer REFERENCES Person
374
A table of known Arch archive locations.
376
CREATE TABLE ArchArchiveLocation (
377
archive integer NOT NULL REFERENCES ArchArchive,
378
archivetype integer NOT NULL REFERENCES Label, -- the Arch archive type
380
gpgsigned boolean NOT NULL
387
An Arch Branch in the Soyuz system.
389
CREATE TABLE Branch (
390
branch serial PRIMARY KEY,
391
archive integer NOT NULL REFERENCES ArchArchive,
392
categorybranchversion text NOT NULL,
394
description text NOT NULL,
395
visible boolean NOT NULL,
396
owner integer REFERENCES Person
404
CREATE TABLE Changeset (
405
changeset serial PRIMARY KEY,
406
branch integer NOT NULL REFERENCES Branch,
407
createdate timestamp NOT NULL,
408
logmessage text NOT NULL,
409
author integer REFERENCES Person,
410
gpgkey integer REFERENCES GPGKey
417
A filename in an arch changeset.
419
CREATE TABLE ChangesetFileName (
420
changesetfilename serial PRIMARY KEY,
421
filename text NOT NULL UNIQUE
428
A file in an arch changeset.
430
CREATE TABLE ChangesetFile (
431
changesetfile serial PRIMARY KEY,
432
changeset integer NOT NULL REFERENCES Changeset,
433
changesetfilename integer NOT NULL REFERENCES ChangesetFileName,
434
filecontents bytea NOT NULL,
435
filesize integer NOT NULL,
436
UNIQUE ( changeset, changesetfilename )
443
A cryptographic hash of a changeset file.
445
CREATE TABLE ChangesetFileHash (
446
changesetfile integer NOT NULL REFERENCES ChangesetFile,
447
hashalg integer NOT NULL REFERENCES Label,
455
A table of relationships between branches. For example:
456
"src is a debianization-branch-of dst"
457
"src is-a-patch-branch-of dst
459
CREATE TABLE Branch_Relationship (
460
src integer NOT NULL REFERENCES Branch,
461
dst integer NOT NULL REFERENCES Branch,
462
label integer NOT NULL REFERENCES Label,
463
PRIMARY KEY ( src, dst )
471
A table of labels on branches.
473
CREATE TABLE BranchLabel (
474
branch int NOT NULL REFERENCES Branch,
475
label int NOT NULL REFERENCES Label
483
A release manifest. This is sort of an Arch config
484
on steroids. A Manifest is a set of ManifestEntry's
486
CREATE TABLE Manifest (
487
manifest serial PRIMARY KEY,
488
creationdate timestamp NOT NULL,
489
brancharchive integer REFERENCES ArchArchive, --
490
branchcategory text, -- Where to put new patch-branches
491
branchversion text --
499
An entry in a Manifest. each entry specifies either a branch or
500
a specific changeset (revision) on a branch, as well as how that
501
piece of code (revision) is brought into the release.
503
CREATE TABLE ManifestEntry (
504
manifest integer NOT NULL REFERENCES Manifest,
505
sequence integer NOT NULL,
506
branch integer REFERENCES Branch,
507
changeset integer REFERENCES Changeset,
508
entrytype integer NOT NULL REFERENCES Label,
510
patchon integer NOT NULL,
511
-- sequence must be a positive integer
512
CHECK ( sequence > 0 ),
513
-- EITHER branch OR changeset:
514
CHECK ( NOT ( branch IS NOT NULL AND changeset IS NOT NULL ) ),
515
-- the "patchon" must be another manifestentry from the same
516
-- manifest, and a different sequence
517
-- XXX no idea how to express this constraint, help!
518
-- the primary key is the combination of manifest and sequence
519
PRIMARY KEY ( manifest, sequence )
525
FLOSS. THE OPEN SOURCE WORLD
526
This is the Soyuz subsystem that models the open source world
527
of projects and products.
532
The Project table. This stores information about an open
533
source project, which can be translated or packaged, or
534
about which bugs can be filed.
536
CREATE TABLE Project (
537
project serial PRIMARY KEY,
538
owner integer NOT NULL REFERENCES Person,
539
name text NOT NULL UNIQUE,
547
The Project_Relationship table. This stores information about
548
the relationships between open source projects. For example,
549
the Gnome project aggregates the GnomeMeeting project.
551
CREATE TABLE Project_Relationship (
552
src integer NOT NULL REFERENCES Project,
553
dst integer NOT NULL REFERENCES Project,
554
relationship text NOT NULL,
562
A table of project products. A product is something that
563
can be built, or a branch of code that is useful elsewhere, or
564
a set of docs... some distinct entity. Products can be made
565
up of other products, but that is not reflected in this
566
database. For example, Firefax includes Gecko, both are
569
CREATE TABLE Product (
570
product serial PRIMARY KEY,
571
project integer NOT NULL REFERENCES Project,
572
owner integer NOT NULL REFERENCES Person,
575
description text NOT NULL,
577
manifest integer REFERENCES Manifest,
578
UNIQUE ( project, name )
585
A label or metadata on a Product.
587
CREATE TABLE ProductLabel (
588
product integer NOT NULL REFERENCES Product,
589
label integer NOT NULL REFERENCES Label,
590
PRIMARY KEY ( product, label )
597
A specific tarball release of Upstream.
599
CREATE TABLE UpstreamRelease (
600
upstreamrelease serial PRIMARY KEY,
601
product integer NOT NULL REFERENCES Product,
602
releasedate timestamp NOT NULL,
606
owner integer REFERENCES Person
617
A table to model Arch configs.
619
CREATE TABLE ArchConfig (
620
archconfig serial PRIMARY KEY,
623
description text NOT NULL,
624
upstreamrelease integer REFERENCES UpstreamRelease,
625
owner integer REFERENCES Person
632
A table to represent the entries in an Arch config. Each
633
row is a separate entry in the arch config.
635
CREATE TABLE ArchConfigEntry (
636
archconfig integer NOT NULL REFERENCES ArchConfig,
638
branch integer REFERENCES Branch,
639
changeset integer REFERENCES Changeset,
640
-- EITHER branch OR changeset:
641
CHECK ( NOT ( branch IS NULL AND changeset IS NULL ) ),
642
CHECK ( NOT ( branch IS NOT NULL AND changeset IS NOT NULL ) )
648
LOGISTIX. THE PACKAGES AND DISTRIBUTION MANAGER.
649
Nicknamed after UPS (United Parcel Service) this is the
650
Soyuz subsystem that deals with distribution and packages.
657
A family of CPU's, which are all compatible. In other words, code
658
compiled for any one of these processors will run on any of the
661
CREATE TABLE ProcessorFamily (
662
processorfamily serial PRIMARY KEY,
663
name text NOT NULL UNIQUE,
665
description text NOT NULL,
666
owner integer NOT NULL REFERENCES Person
673
This is a table of system architectures. A DistroArchRelease needs
676
CREATE TABLE Processor (
677
processor serial PRIMARY KEY,
678
family integer NOT NULL REFERENCES ProcessorFamily,
679
name text NOT NULL UNIQUE,
681
description text NOT NULL,
682
owner integer NOT NULL REFERENCES Person
689
An Ubuntu build daemon.
691
CREATE TABLE Builder (
692
builder serial PRIMARY KEY,
693
processor integer NOT NULL REFERENCES Processor,
697
description integer NOT NULL REFERENCES Person,
698
UNIQUE ( fqdn, name )
705
An open source distribution. Collection of packages, the reason
708
CREATE TABLE Distribution (
709
distribution serial PRIMARY KEY,
712
description text NOT NULL,
713
components integer NOT NULL REFERENCES Schema,
714
sections integer NOT NULL REFERENCES Schema,
715
owner integer NOT NULL REFERENCES Person
722
These are releases of the various distributions in the system. For
723
example: warty, hoary, grumpy, woody, potato, slink, sarge, fc1,
726
CREATE TABLE DistroRelease (
727
distrorelease serial PRIMARY KEY,
728
distribution integer NOT NULL REFERENCES Distribution,
729
name text NOT NULL, -- "warty"
730
title text NOT NULL, -- "Ubuntu 4.10 (The Warty Warthog Release)"
731
description text NOT NULL,
732
version text NOT NULL, -- "4.10"
733
releasestate integer NOT NULL REFERENCES Label
741
This is a distrorelease for a particular architecture, for example,
744
CREATE TABLE DistroArchRelease (
745
distroarchrelease serial PRIMARY KEY,
746
distrorelease integer NOT NULL REFERENCES DistroRelease,
747
processor integer NOT NULL REFERENCES Processor,
748
architecturetag text NOT NULL,
749
releasestatus integer NOT NULL REFERENCES Label,
750
releasedate timestamp,
751
owner integer NOT NULL REFERENCES Person
758
The Soyuz system keeps copies of all the files that are used to make
759
up a distribution, such as deb's and tarballs and .dsc files and .spec
760
files and CodeRelease files... these are represented by this table.
762
CREATE TABLE SoyuzFile (
763
soyuzfile serial PRIMARY KEY,
764
filename text NOT NULL,
765
filesize integer NOT NULL
772
A hash (cryptographic digest) on the file. We can support multiple
773
different hashes with different algorithms. Initially we'll just
774
use SHA1, but if that gets broken we can trivially switch to another
777
The hash is not required to be UNIQUE but Oscar should flag duplicates
778
for inspection by hand. Note that the combination of filesize and hash
779
should be unique or there is something very weird going on. Or we just hit
780
the crypto lottery and found a collision.
782
CREATE TABLE SoyuzFileHash (
783
soyuzfile integer NOT NULL REFERENCES SoyuzFile,
784
hashalg integer NOT NULL REFERENCES Label,
792
A file from an Upstream CodeRelease. Usually this would be a tarball.
794
CREATE TABLE UpstreamReleaseFile (
795
upstreamrelease integer NOT NULL REFERENCES UpstreamRelease,
796
soyuzfile integer NOT NULL REFERENCES SoyuzFile,
797
filetype integer NOT NULL REFERENCES Label,
798
filename text NOT NULL
805
A distribution source package. In RedHat or Debian this is the name
806
of the source package, in Gentoo it's the Ebuild name.
808
CREATE TABLE Sourcepackage (
809
sourcepackage serial PRIMARY KEY,
810
maintainer integer NOT NULL REFERENCES Person,
813
description text NOT NULL,
814
manifest integer REFERENCES Manifest
820
Sourcepackage_Relationship
821
The relationship between two source packages. For example, if a source
822
package in Ubuntu is derived from a source package in Debian, we would
825
CREATE TABLE Sourcepackage_Relationship (
826
src integer NOT NULL REFERENCES Sourcepackage,
827
dst integer NOT NULL REFERENCES Sourcepackage,
828
label integer NOT NULL REFERENCES Sourcepackage,
836
A tag or label on a source package.
838
CREATE TABLE SourcepackageLabel (
839
sourcepackage integer NOT NULL REFERENCES Sourcepackage,
840
label integer NOT NULL REFERENCES Label
848
This is really the relationship between a Product and a
849
Sourcepackage. For example, it allows us to say that
850
the apache2 source package is a packaging of the
851
httpd Product from the Apache Group.
853
CREATE TABLE Packaging (
854
product integer NOT NULL REFERENCES Product,
855
sourcepackage integer NOT NULL REFERENCES Sourcepackage,
856
label integer NOT NULL REFERENCES Label
864
A SourcepackageRelease is a specific release of a Sourcepackage, which is
865
associated with one or more distribution releases. So apache2__2.0.48-3 can
866
be in both ubuntu/warty and debian/sarge.
868
CREATE TABLE SourcepackageRelease (
869
sourcepackagerelease serial PRIMARY KEY,
870
sourcepackage integer NOT NULL REFERENCES Sourcepackage,
871
srcpackageformat integer NOT NULL REFERENCES Label,
872
creator integer NOT NULL REFERENCES Person,
873
version text NOT NULL, -- "2.0.48-3"
874
dateuploaded timestamp NOT NULL,
875
urgency integer NOT NULL REFERENCES Label,
876
dscsigningkey integer REFERENCES GPGKey,
877
component integer REFERENCES Label,
881
builddependsindep text,
882
architecturehintlist text
888
SourcepackageReleaseFile
889
A file associated with a sourcepackagerelease. For example, could be
890
a .dsc file, or an orig.tar.gz, or a diff.gz...
892
CREATE TABLE SourcepackageReleaseFile (
893
sourcepackagerelease integer NOT NULL REFERENCES SourcepackageRelease,
894
soyuzfile integer NOT NULL REFERENCES SoyuzFile,
895
filetype integer NOT NULL REFERENCES Label,
896
filename text NOT NULL
903
This table indicates which sourcepackagereleases are present in a
904
given distrorelease. It also indicates their status in that release
905
(for example, whether or not that sourcepackagerelease has been
906
withdrawn, or is currently published, in that archive).
908
CREATE TABLE SourcepackageUpload (
909
distrorelease integer NOT NULL REFERENCES DistroRelease,
910
sourcepackagerelease integer NOT NULL REFERENCES SourcepackageRelease,
911
packagereleasestatus integer NOT NULL REFERENCES Label,
912
PRIMARY KEY ( distrorelease, sourcepackagerelease )
919
This is a binary package... not an actual built package (that
920
is a BinarypackageBuild) but the concept of that binary package.
921
It stores the name of the binary package, together with other
922
details. Note that different distributions might well have
923
different binary packages with the same name. In fact, a single
924
distribution might have binary packages with the same name at
925
different times, that have entirely different source packages
926
and hence maintainers.
928
CREATE TABLE Binarypackage (
929
binarypackage serial PRIMARY KEY,
932
description text NOT NULL
940
This is an actual package, built on a specific architecture,
941
ready for installation.
943
CREATE TABLE BinarypackageBuild (
944
binarypackagebuild serial PRIMARY KEY,
945
sourcepackagerelease integer NOT NULL REFERENCES SourcepackageRelease,
946
binarypackage integer NOT NULL REFERENCES Binarypackage,
947
processor integer NOT NULL REFERENCES Processor,
948
binpackageformat integer NOT NULL REFERENCES Label,
949
version text NOT NULL,
950
builddate timestamp NOT NULL,
951
gpgsigningkey integer REFERENCES GPGKey,
952
component integer REFERENCES Label,
953
section integer REFERENCES Label,
954
priority integer REFERENCES Label,
963
installedsize integer
969
BinarypackageBuildFile
970
This is a file associated with a built binary package. Could
971
be a .deb or an rpm, or something similar from a gentoo box.
973
CREATE TABLE BinarypackageBuildFile (
974
binarypackagebuild integer NOT NULL REFERENCES BinarypackageBuild,
975
soyuzfile integer NOT NULL REFERENCES SoyuzFile,
976
filetype integer NOT NULL REFERENCES Label,
977
filename text NOT NULL
984
This table records the status of a binarypackagebuild (deb) in a
985
distrorelease (woody)
987
CREATE TABLE BinarypackageUpload (
988
binarypackagebuild integer NOT NULL REFERENCES BinarypackageBuild,
989
distrorelease integer NOT NULL REFERENCES DistroRelease,
990
packagestatus integer NOT NULL REFERENCES Label
997
LIBRARIAN. TRACKING UPSTREAM AND SOURCE PACKAGE RELEASES.
998
This section is devoted to data that tracks upstream and distribution
999
SOURCE PACKAGE releases. So, for example, Apache 2.0.48 is an
1000
UpstreamRelease. Apache 2.0.48-3 is a Debian SourcepackageRelease.
1001
We have data tables for both of those, and the CodeRelease table is
1002
the data that is common to any kind of CodeRelease. This subsystem also
1003
keeps track of the actual files associated with CodeReleases, such as
1004
tarballs and deb's and .dsc files and changelog files...
1011
A release of software. Could be an Upstream release or
1012
a SourcepackageRelease.
1014
CREATE TABLE CodeRelease (
1015
coderelease serial PRIMARY KEY,
1016
upstreamrelease integer REFERENCES UpstreamRelease,
1017
sourcepackagerelease integer REFERENCES SourcepackageRelease,
1018
manifest integer REFERENCES Manifest,
1019
CHECK ( NOT ( upstreamrelease IS NULL AND sourcepackagerelease IS NULL ) ),
1020
CHECK ( NOT ( upstreamrelease IS NOT NULL AND sourcepackagerelease IS NOT NULL ) )
1021
); -- EITHER upstreamrelease OR sourcepackagerelease must not be NULL
1026
CodeRelease_Relationship
1027
Maps the relationships between releases (upstream and
1030
CREATE TABLE CodeRelease_Relationship (
1031
src integer NOT NULL REFERENCES CodeRelease,
1032
dst integer NOT NULL REFERENCES CodeRelease,
1033
label integer NOT NULL REFERENCES Label,
1034
PRIMARY KEY ( src, dst )
1042
This is a file in one of the OS's managed in Soyuz.
1044
CREATE TABLE OSFile (
1045
osfile serial PRIMARY KEY,
1046
path text NOT NULL UNIQUE
1053
This table tells us all the files that are in a given binary package
1054
build. It also includes information about the files, such as their
1055
unix permissions, and whether or not they are a conf file.
1057
CREATE TABLE OSFileInPackage (
1058
osfile integer NOT NULL REFERENCES OSFile,
1059
binarypackagebuild integer NOT NULL REFERENCES BinarypackageBuild,
1060
unixperms integer NOT NULL,
1061
conffile boolean NOT NULL,
1062
createdby boolean NOT NULL
1068
ROSETTA. THE TRANSLATION SUPER-PORTAL
1069
This is the Soyuz subsystem that coordinates and manages
1070
the translation of open source software and documentation.
1077
A set of "sunglasses" through which we see translations. We only want
1078
to see translations that are compatible with this filter in terms
1079
of licence, review and contribution criteria. This will not be
1080
implemented in Rosetta v1.0
1082
CREATE TABLE TranslationFilter (
1083
translationfilter serial PRIMARY KEY,
1084
owner integer NOT NULL REFERENCES Person,
1092
The TranslationEffort table. Stores information about each active
1093
translation effort. Note, a translationeffort is an aggregation of
1094
works. For example, the Gnome Translation Project, which aims to
1095
translate the PO files for many gnome applications. This is a point
1096
for the translation team to rally around.
1098
CREATE TABLE TranslationEffort (
1099
translationeffort serial PRIMARY KEY,
1100
owner integer NOT NULL REFERENCES Person,
1101
title text NOT NULL,
1102
description text NOT NULL,
1103
translationfilter integer REFERENCES TranslationFilter
1110
Project_TranslationEffort_Relationship
1111
Maps the way a translation project is related to an open source
1114
CREATE TABLE Project_TranslationEffort_Relationship (
1115
project integer NOT NULL REFERENCES Project,
1116
translationeffort integer NOT NULL REFERENCES TranslationEffort,
1117
label integer NOT NULL REFERENCES Label,
1118
PRIMARY KEY ( project, translationeffort )
1126
A handle on an inheritance sequence for POT files.
1128
CREATE TABLE POTInheritance (
1129
potinheritance serial PRIMARY KEY,
1138
A license. We need quite a bit more in the long term
1139
to track licence compatibility etc.
1141
CREATE TABLE License (
1142
license serial PRIMARY KEY,
1143
legalese text NOT NULL
1149
A PO Template File, which is the first thing that Rosetta will set
1152
CREATE TABLE POTFile (
1153
potfile serial PRIMARY KEY,
1154
project integer NOT NULL REFERENCES Project,
1155
branch integer REFERENCES Branch,
1156
changeset integer REFERENCES Changeset,
1157
name text NOT NULL UNIQUE,
1158
title text NOT NULL,
1159
description text NOT NULL,
1160
copyright text NOT NULL,
1161
license integer NOT NULL REFERENCES License,
1162
datecreated timestamp NOT NULL,
1164
iscurrent boolean NOT NULL,
1165
defaultinheritance integer REFERENCES POTInheritance,
1166
defaultfilter integer REFERENCES TranslationFilter,
1167
owner integer REFERENCES Person,
1168
-- EITHER branch OR changeset:
1169
CHECK ( NOT ( branch IS NULL AND changeset IS NULL ) ),
1170
CHECK ( NOT ( branch IS NOT NULL AND changeset IS NOT NULL ) )
1177
A PO or POT File MessageID
1179
CREATE TABLE POMsgID (
1180
pomsgid serial PRIMARY KEY,
1188
A PO translation. This is just a piece of text, where the
1189
"translation" might in fact be the original language.
1191
CREATE TABLE POTranslation (
1192
potranslation serial PRIMARY KEY,
1200
A table of languages, for Rosetta.
1202
CREATE TABLE Language (
1203
language serial PRIMARY KEY,
1204
code text NOT NULL UNIQUE,
1214
A list of countries.
1216
CREATE TABLE Country (
1217
country serial PRIMARY KEY,
1218
iso3166code2 text NOT NULL,
1219
iso3166code3 text NOT NULL,
1221
title text NOT NULL,
1222
description text NOT NULL
1229
A table linking countries the languages spoken in them.
1231
CREATE TABLE SpokenIn (
1232
language integer NOT NULL REFERENCES Language,
1233
country integer NOT NULL REFERENCES Country,
1234
PRIMARY KEY ( language, country )
1241
A PO File. This is a language-specific set of translations.
1243
CREATE TABLE POFile (
1244
pofile serial PRIMARY KEY,
1245
potfile integer NOT NULL REFERENCES POTFile,
1246
language integer NOT NULL REFERENCES Language,
1249
topcomment text, -- the comment at the top of the file
1250
header text, -- the contents of the NULL msgstr
1251
lasttranslator integer REFERENCES Person,
1252
license integer REFERENCES License,
1253
completeness integer -- between 0 and 100
1260
Table that documents the sighting of a particular msgid in a pot file.
1262
CREATE TABLE POTMsgIDSighting (
1263
potfile integer NOT NULL REFERENCES POTFile,
1264
pomsgid integer NOT NULL REFERENCES POMsgID,
1265
firstseen timestamp NOT NULL,
1266
lastseen timestamp NOT NULL,
1267
iscurrent boolean NOT NULL,
1269
singular integer REFERENCES POMsgID, -- if this is not NULL then it's part of a tuple
1270
PRIMARY KEY ( potfile, pomsgid )
1276
POTranslationSighting
1277
A sighting of a translation in a PO file IN REVISION CONTROL. This
1278
is contrasted with a RosettaPOTranslationSighting, which is a
1279
translation given to us for a potfile/language.
1281
CREATE TABLE POTranslationSighting (
1282
potranslationsighting serial PRIMARY KEY,
1283
pofile integer NOT NULL REFERENCES POFile,
1284
pomsgid integer NOT NULL REFERENCES POMsgID,
1285
potranslation integer NOT NULL REFERENCES POTranslation,
1286
license integer NOT NULL REFERENCES License,
1287
fuzzy boolean NOT NULL,
1288
rosettaprovided boolean NOT NULL,
1289
firstseen timestamp NOT NULL,
1290
lastseen timestamp NOT NULL,
1291
iscurrent boolean NOT NULL,
1294
CHECK ( pluralform >= 0 )
1300
RosettaPOTranslationSighting
1301
A record of a translation given to Rosetta through the web, or
1302
web service, or otherwise.
1304
CREATE TABLE RosettaPOTranslationSighting (
1305
rosettapotranslation serial PRIMARY KEY,
1306
person integer NOT NULL REFERENCES Person,
1307
potfile integer NOT NULL REFERENCES POTFile,
1308
pomsgid integer NOT NULL REFERENCES POMsgID,
1309
language integer NOT NULL REFERENCES Language,
1310
potranslation integer NOT NULL REFERENCES POTranslation,
1311
license integer NOT NULL REFERENCES License,
1312
dateprovided timestamp NOT NULL,
1313
datetouched timestamp NOT NULL,
1315
CHECK ( pluralform >= 0 )
1322
A table of comments provided by translators and the translation
1323
system (these are extracted from PO files as well as provided to
1324
us through the web and web services API).
1326
CREATE TABLE POComment (
1327
pocomment serial PRIMARY KEY,
1328
potfile integer NOT NULL REFERENCES POTFile,
1329
pomsgid integer REFERENCES POMsgID,
1330
language integer REFERENCES Language,
1331
potranslation integer REFERENCES POTranslation,
1332
commenttext text NOT NULL,
1333
date timestamp NOT NULL,
1334
person integer REFERENCES Person
1341
TranslationEffort_POTFile_Relationship
1342
A translation project incorporates a POTfile that is under translation.
1343
The inheritance pointer allows this project to specify a custom
1344
translation inheritance sequence.
1346
CREATE TABLE TranslationEffort_POTFile_Relationship (
1347
translationeffort integer NOT NULL REFERENCES TranslationEffort ON DELETE CASCADE,
1348
potfile integer NOT NULL REFERENCES POTFile,
1349
potinheritance integer REFERENCES POTInheritance,
1350
UNIQUE (translationeffort , potfile)
1356
Project_POTFile_Relationship
1357
Captures the relationship between a Project and a translated POTFile.
1358
CREATE TABLE Project_POTFile_Relationship (
1359
project integer NOT NULL REFERENCES Project,
1360
potfile integer NOT NULL REFERENCES POTFile,
1361
label integer NOT NULL REFERENCES Label
1370
Records the people who have subscribed to a POT File. They can
1371
subscribe to the POT file and get all the PO files, or just the PO
1372
files for a specific language.
1374
CREATE TABLE POTSubscription (
1375
potsubscription serial PRIMARY KEY,
1376
person integer NOT NULL REFERENCES Person,
1377
language integer REFERENCES Language,
1378
notificationinterval interval NOT NULL,
1379
lastnotified timestamp,
1380
potinheritance integer REFERENCES POTInheritance,
1381
translationfilter integer REFERENCES TranslationFilter
1387
BOOGER. THE ISSUE TRACKING SYSTEM.
1388
This is the Soyuz subsystem that handled bugs and issue
1389
tracking for all the distributions we know about.
1395
The core bug entry. A Booger.
1398
bug serial PRIMARY KEY,
1399
datecreated timestamp NOT NULL,
1400
summary text NOT NULL,
1401
description text NOT NULL,
1402
owner integer NOT NULL,
1403
duplicateof integer REFERENCES Bug,
1404
communityscore integer NOT NULL,
1405
communitytimestamp timestamp NOT NULL,
1406
activityscore integer NOT NULL,
1407
activitytimestamp timestamp NOT NULL,
1408
hits integer NOT NULL,
1409
hitstimestamp timestamp NOT NULL
1415
CodeReleaseBugStatus
1416
This is a bug status scorecard. It's not a global status for the
1417
bug, this is usually attached to a release, or a sourcepackage in
1418
a distro. So these tell you the status of a bug SOMEWHERE. The
1419
pointer to this tells you which bug, and on what thing (the
1420
SOMEWHERE) the status is being described.
1422
CREATE TABLE CodeReleaseBugStatus (
1423
bug integer NOT NULL REFERENCES Bug,
1424
coderelease integer NOT NULL REFERENCES CodeRelease,
1425
explicit boolean NOT NULL,
1426
bugstatus integer NOT NULL REFERENCES Label,
1427
priority integer NOT NULL REFERENCES Label,
1428
severity integer NOT NULL REFERENCES Label,
1429
reportedby integer NOT NULL REFERENCES Person,
1430
verifiedby integer NOT NULL REFERENCES Person,
1431
lastmodifiedby integer NOT NULL REFERENCES Person,
1432
PRIMARY KEY ( bug, coderelease )
1438
SourcepackageBugStatus
1439
The status of a bug with regard to a source package. This is different
1440
to the status on a specific release, because it includes the concept
1441
of workflow or prognosis ("what we intend to do with this bug") while
1442
the release bug status is static ("is the bug present or not").
1444
CREATE TABLE SourcepackageBugStatus (
1445
bug integer NOT NULL REFERENCES Bug,
1446
sourcepackage integer NOT NULL REFERENCES Sourcepackage,
1447
bugstatus integer NOT NULL REFERENCES Label,
1448
binarypackagename text,
1449
wontfix boolean NOT NULL,
1450
PRIMARY KEY ( bug, sourcepackage )
1456
Bug_Sourcepackage_Relationship
1457
This is a mapping of the relationship between a bug and a source
1458
package. Note that there is another similar table, the SourcepackageBugStatus,
1459
that is dedicated to the status of a bug in a source package. This one is
1460
a bit more subtle. For example, you might put an intry in this table to
1461
indicate that a bug "victimises" a source package. In other words, the
1462
bug itself does not appear in this sourcepackage, but the functionality
1463
of the sourcepackage is somehow impacted by the bug.
1465
CREATE TABLE Bug_Sourcepackage_Relationship (
1466
bug integer NOT NULL REFERENCES Bug,
1467
sourcepackage integer NOT NULL REFERENCES Sourcepackage,
1468
label integer NOT NULL REFERENCES Label
1475
The status of a bug with regard to a product. This is different
1476
to the status on a specific release, because it includes the concept
1477
of workflow or prognosis ("what we intend to do with this bug") while
1478
the release bug status is static ("is the bug present or not").
1480
CREATE TABLE ProductBugStatus (
1481
bug integer NOT NULL REFERENCES Bug,
1482
product integer NOT NULL REFERENCES Sourcepackage,
1483
bugstatus integer NOT NULL REFERENCES Label,
1484
binarypackagename text,
1485
wontfix boolean NOT NULL,
1486
PRIMARY KEY ( bug, product )
1493
A log of all the things that have happened to a bug, as Dave wants
1494
to keep track of it.
1496
CREATE TABLE BugActivity (
1497
bug integer NOT NULL REFERENCES Bug,
1498
activitydate timestamp NOT NULL,
1499
person integer NOT NULL,
1500
whatchanged text NOT NULL,
1501
oldvalue text NOT NULL,
1502
newvalue text NOT NULL,
1503
message text NOT NULL
1505
-- XXX this does not have a primary key, theory says it needs one!
1512
A table of external references for a bug, that are NOT remote
1513
bug system references, except where the remote bug system is
1514
not supported by the BugWatch table.
1516
CREATE TABLE BugRef (
1517
bugref serial PRIMARY KEY,
1518
bug integer NOT NULL REFERENCES Bug,
1519
bugreftype integer NOT NULL REFERENCES Label,
1521
description text NOT NULL,
1522
owner integer NOT NULL REFERENCES Person
1529
This is a table of bug tracking system types. We don't have much
1530
version granularity (Bugzilla 2.15 is treated the same as Bugzilla 2.17
1531
unless you create them as two separate bug system types). This table is
1532
used by the BugSystem table to indicate the type of a remote bug system.
1534
CREATE TABLE BugSystemType (
1535
bugsystemtype serial PRIMARY KEY,
1536
title text NOT NULL,
1537
description text NOT NULL,
1539
product integer REFERENCES Product, -- A Soyuz Product if it exists
1540
owner integer NOT NULL REFERENCES Person -- who knows most about these
1543
INSERT INTO BugSystemType VALUES ( 1, "Bugzilla", "Dave Miller's Labour of Love, the Godfather of Open Source project issue tracking.", "http://www.bugzilla.org", NULL, 2 );
1544
INSERT INTO BugSystemType VALUES ( 2, "DebBugs", "The Debian bug tracking system, ugly as sin but fast and productive as a rabbit in high heels.", "http://bugs.debian.org", NULL, 3 );
1545
INSERT INTO BugSystemType VALUES ( 3, "RoundUp", "Python-based open source bug tracking system with an elegant design and reputation for cleanliness and usability.", NULL, 4 );
1551
A table of remote bug systems (for example, Debian's DebBugs, and
1552
Mozilla's Bugzilla, and SourceForge's tracker...). The baseurl is the
1553
top of the bug system's tree, from which the URL to a given bug
1554
status can be determined.
1556
CREATE TABLE BugSystem (
1557
bugsystem serial PRIMARY KEY,
1558
bugsystemtype integer NOT NULL REFERENCES BugSystemType,
1560
description text NOT NULL,
1561
baseurl text NOT NULL,
1562
owner integer NOT NULL REFERENCES Person
1569
This is a table of bugs in remote bug systems (for example, upstream
1570
bugzilla's) which we want to monitor for status changes.
1572
CREATE TABLE BugWatch (
1573
bugwatch serial PRIMARY KEY,
1574
bugsystem integer NOT NULL REFERENCES BugSystem,
1575
remotebug text NOT NULL, -- unique identifier of bug in that system
1576
remotestatus text NOT NULL, -- textual representation of status
1577
lastchanged timestamp NOT NULL,
1578
lastchecked timestamp NOT NULL,
1579
owner integer NOT NULL REFERENCES Person,
1580
datecreated timestamp NOT NULL
1588
A table of attachments to bugs. These are typically patches, screenshots,
1589
mockups, or other documents.
1591
CREATE TABLE BugAttachment (
1592
bugattachment serial PRIMARY KEY,
1593
owner integer NOT NULL REFERENCES Person,
1594
content text NOT NULL,
1595
title text NOT NULL,
1596
description text NOT NULL,
1598
replaces integer REFERENCES BugAttachment
1604
BugAttachment_Relationship
1605
A link between bug and attachment that carries some type
1608
CREATE TABLE BugAttachment_Relationship (
1609
bug integer NOT NULL REFERENCES Bug,
1610
bugattachment integer NOT NULL REFERENCES BugAttachment,
1611
label integer NOT NULL REFERENCES Label,
1612
PRIMARY KEY ( bug, bugattachment )
1619
Allows us to attache arbitrary metadata to a bug.
1621
CREATE TABLE BugLabel (
1622
bug integer NOT NULL REFERENCES Bug,
1623
label integer NOT NULL REFERENCES Label,
1624
PRIMARY KEY ( bug, label )
1632
The relationship between two bugs, with a label.
1634
CREATE TABLE Bug_Relationship (
1635
src integer NOT NULL REFERENCES Bug,
1636
dst integer NOT NULL REFERENCES Bug,
1637
label integer NOT NULL REFERENCES Label
1645
A table of messages about bugs. Could be from the web
1646
forum, or from email, we don't care and treat them both
1647
equally. A message can apply to multiple forums.
1649
CREATE TABLE BugMessage (
1650
bugmessage serial PRIMARY KEY,
1651
msgdate timestamp NOT NULL,
1652
message text NOT NULL, -- the message or full email with headers
1653
person int REFERENCES Person, -- NULL if we don't know it
1654
senderemail text, -- NULL if this came through the web
1655
parent int REFERENCES BugMessage, -- gives us threading
1656
distribution int REFERENCES Distribution,
1665
CREATE TABLE BugMessageSighting (
1666
bug integer NOT NULL REFERENCES Bug,
1667
bugmessage integer NOT NULL REFERENCES BugMessage