8
- all dates and timestamps MUST be in UTC
10
9
- re-evalutate some of the "text" field types, they might need
12
11
unless we can guarantee utf-8
12
- add sample data for the schemas
13
13
- make sure names are only [a-z][0-9][-.+] and can only start
15
15
- set DEFAULT's for datestamps (now) and others
23
- add BugAttachmentContent.id for Stuart Bishop
24
- and move the BugAttachment.name to BugAttachmentContent
25
- make ProductRelease.version NOT NULL and add a .changelog
26
- don't require homepageurl for Project or Product
27
- add ChangesetFileHash.id for Robert Weir
28
- rename UpstreamRelease to ProductRelease
30
23
- merge SourceSource table from Andrew Bennetts
31
24
- change SourceSource.homepageurl to SourceSource.product
32
25
- BugInfestation: dateverified and verifiedby need to be NULL
33
26
if its not verified
34
27
- set a lot of datecreated and lastverified etc fields to
35
DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC')
28
DEFAULT CURRENT_TIMESTAMP
36
29
- use Andrew Bennett's way of putting comments inside the table
38
31
line being commented, it makes lines shorter.
57
50
- move add POMsgSet.current
58
51
- add POTranslationSighting.deprecated
59
52
- rename POTranslationSighting.lastseen -> .lasttouched
60
- make Project.product NOT NULL
61
- add stats gathering to POTemplate and POFile
63
54
- rename Membership.label to Membership.role
64
55
- rename EmailAddress.label to EmailAddress.status
127
118
Product and a Sourcepackage
129
120
- make Schema and Label have name, title, description
130
- added filenames for ProductreleaseFile, SourcepackageFile
121
- added filenames for UpstreamreleaseFile, SourcepackageFile
131
122
and BinarypackageBuildFile
132
123
- linked BinarypackageBuild to DistroRelease instead of
133
124
DistroArchRelease
177
168
DROP TABLE ProjectBugsystem;
178
169
DROP TABLE BugWatch;
179
170
DROP TABLE BugSystem;
180
DROP TABLE BugAttachmentContent;
171
DROP TABLE BugattachmentContent;
181
172
DROP TABLE BugAttachment;
182
173
DROP TABLE POTranslationSighting;
183
174
DROP TABLE POMsgIDSighting;
213
204
DROP TABLE Sourcepackage;
214
205
DROP TABLE ArchConfigEntry;
215
206
DROP TABLE ArchConfig;
216
DROP TABLE ProductReleaseFile;
217
DROP TABLE ProductRelease;
207
DROP TABLE UpstreamReleaseFile;
208
DROP TABLE UpstreamRelease;
218
209
DROP TABLE ChangesetFileHash;
219
210
DROP TABLE ChangesetFile;
220
211
DROP TABLE ChangesetFileName;
527
517
archnamespace integer NOT NULL REFERENCES ArchNamespace,
528
518
title text NOT NULL,
529
519
description text NOT NULL,
520
visible boolean NOT NULL,
530
521
owner integer REFERENCES Person
583
574
A cryptographic hash of a changeset file.
585
576
CREATE TABLE ChangesetFileHash (
586
id serial PRIMARY KEY,
587
577
changesetfile integer NOT NULL REFERENCES ChangesetFile,
588
578
/* see Hash Algorithms schema */
589
579
hashalg integer NOT NULL,
684
674
name text NOT NULL UNIQUE,
685
675
title text NOT NULL,
686
676
description text NOT NULL,
687
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
677
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
678
homepageurl text NOT NULL
719
709
name text NOT NULL,
720
710
title text NOT NULL,
721
711
description text NOT NULL,
722
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
712
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
713
homepageurl text NOT NULL,
724
714
manifest integer REFERENCES Manifest,
725
715
UNIQUE ( project, name ),
726
716
-- ( id, project ) must be unique so it can be a foreign key
746
A specific tarball release of Product.
736
A specific tarball release of Upstream.
748
CREATE TABLE ProductRelease (
738
CREATE TABLE UpstreamRelease (
749
739
id serial PRIMARY KEY,
750
740
product integer NOT NULL REFERENCES Product,
751
741
datereleased timestamp NOT NULL,
752
742
-- the version without anything else, "1.3.29"
753
version text NOT NULL,
754
744
-- the GSV Name "The Warty Web Release"
756
746
description text,
758
owner integer NOT NULL REFERENCES Person,
747
owner integer REFERENCES Person,
759
748
UNIQUE ( product, version )
775
763
name text NOT NULL,
776
764
title text NOT NULL,
777
765
description text NOT NULL,
778
productrelease integer REFERENCES ProductRelease,
766
upstreamrelease integer REFERENCES UpstreamRelease,
779
767
owner integer REFERENCES Person
947
A file from an Product Coderelease. Usually this would be a tarball.
935
A file from an Upstream Coderelease. Usually this would be a tarball.
949
CREATE TABLE ProductReleaseFile (
950
productrelease integer NOT NULL REFERENCES ProductRelease,
937
CREATE TABLE UpstreamReleaseFile (
938
upstreamrelease integer NOT NULL REFERENCES UpstreamRelease,
951
939
launchpadfile integer NOT NULL REFERENCES LaunchpadFile,
952
-- see Product File Type schema
940
-- see Upstream File Type schema
953
941
filetype integer NOT NULL,
954
942
filename text NOT NULL
1032
1020
creator integer NOT NULL REFERENCES Person,
1034
1022
version text NOT NULL,
1035
dateuploaded timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1023
dateuploaded timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1036
1024
-- see Source Package Urgency schema
1037
1025
urgency integer NOT NULL,
1038
1026
dscsigningkey integer REFERENCES GPGKey,
1170
1158
LIBRARIAN. TRACKING UPSTREAM AND SOURCE PACKAGE RELEASES.
1171
This section is devoted to data that tracks product and distribution
1159
This section is devoted to data that tracks upstream and distribution
1172
1160
SOURCE PACKAGE releases. So, for example, Apache 2.0.48 is an
1173
ProductRelease. Apache 2.0.48-3 is a Debian SourcepackageRelease.
1161
UpstreamRelease. Apache 2.0.48-3 is a Debian SourcepackageRelease.
1174
1162
We have data tables for both of those, and the Coderelease table is
1175
1163
the data that is common to any kind of Coderelease. This subsystem also
1176
1164
keeps track of the actual files associated with Codereleases, such as
1184
A release of software. Could be an Product release or
1172
A release of software. Could be an Upstream release or
1185
1173
a SourcepackageRelease.
1187
1175
CREATE TABLE Coderelease (
1188
1176
id serial PRIMARY KEY,
1189
productrelease integer REFERENCES ProductRelease,
1177
upstreamrelease integer REFERENCES UpstreamRelease,
1190
1178
sourcepackagerelease integer REFERENCES SourcepackageRelease,
1191
1179
manifest integer REFERENCES Manifest,
1192
CHECK ( NOT ( productrelease IS NULL AND sourcepackagerelease IS NULL ) ),
1193
CHECK ( NOT ( productrelease IS NOT NULL AND sourcepackagerelease IS NOT NULL ) )
1194
); -- EITHER productrelease OR sourcepackagerelease must not be NULL
1180
CHECK ( NOT ( upstreamrelease IS NULL AND sourcepackagerelease IS NULL ) ),
1181
CHECK ( NOT ( upstreamrelease IS NOT NULL AND sourcepackagerelease IS NOT NULL ) )
1182
); -- EITHER upstreamrelease OR sourcepackagerelease must not be NULL
1200
1188
CodereleaseRelationship
1201
Maps the relationships between releases (product and
1189
Maps the relationships between releases (upstream and
1202
1190
sourcepackage).
1204
1192
CREATE TABLE CodereleaseRelationship (
1263
The TranslationEffort table. Stores information about each active
1264
translation effort. Note, a translationeffort is an aggregation of
1265
resources. For example, the Gnome Translation Project, which aims to
1266
translate the PO files for many gnome applications. This is a point
1267
for the translation team to rally around.
1269
CREATE TABLE TranslationEffort (
1270
id serial PRIMARY KEY,
1271
owner integer NOT NULL REFERENCES Person,
1272
project integer NOT NULL REFERENCES Project,
1273
name text NOT NULL UNIQUE,
1274
title text NOT NULL,
1275
description text NOT NULL
1284
A handle on an inheritance sequence for POT files.
1285
CREATE TABLE POTInheritance (
1286
id serial PRIMARY KEY,
1296
A license. We need quite a bit more in the long term
1297
to track licence compatibility etc.
1299
CREATE TABLE License (
1300
id serial PRIMARY KEY,
1301
legalese text NOT NULL
1308
A PO Template File, which is the first thing that Rosetta will set
1311
CREATE TABLE POTemplate (
1312
id serial PRIMARY KEY,
1313
project integer NOT NULL REFERENCES Project,
1314
product integer REFERENCES Product,
1315
branch integer REFERENCES Branch,
1316
changeset integer REFERENCES Changeset,
1317
name text NOT NULL UNIQUE,
1318
title text NOT NULL,
1319
description text NOT NULL,
1320
copyright text NOT NULL,
1321
license integer NOT NULL REFERENCES License,
1322
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1324
iscurrent boolean NOT NULL,
1325
owner integer REFERENCES Person,
1326
-- EITHER branch OR changeset:
1327
CHECK ( NOT ( branch IS NULL AND changeset IS NULL ) ),
1328
CHECK ( NOT ( branch IS NOT NULL AND changeset IS NOT NULL ) ),
1329
-- make sure, if we refer to a Product, that it is from
1331
FOREIGN KEY ( product, project ) REFERENCES Product ( id, project )
1276
1338
A PO or POT File MessageID
1340
A handle on an inheritance sequence for POT files.
1341
CREATE TABLE POTInheritance (
1342
id serial PRIMARY KEY,
1352
A license. We need quite a bit more in the long term
1353
to track licence compatibility etc.
1355
CREATE TABLE License (
1356
id serial PRIMARY KEY,
1357
legalese text NOT NULL
1364
A PO Template File, which is the first thing that Rosetta will set
1367
CREATE TABLE POTemplate (
1368
id serial PRIMARY KEY,
1369
project integer NOT NULL REFERENCES Project,
1370
product integer NOT NULL REFERENCES Product,
1371
branch integer REFERENCES Branch,
1372
-- see Translation Priority schema
1373
priority integer NOT NULL,
1374
changeset integer REFERENCES Changeset,
1375
name text NOT NULL UNIQUE,
1376
title text NOT NULL,
1377
description text NOT NULL,
1378
copyright text NOT NULL,
1379
license integer NOT NULL REFERENCES License,
1380
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1382
iscurrent boolean NOT NULL,
1383
-- the total number of POMsgSet's associated with this POTemplate
1384
-- when we last parsed the Template.
1385
messagecount integer NOT NULL,
1386
owner integer REFERENCES Person,
1387
-- EITHER branch OR changeset:
1388
CHECK ( NOT ( branch IS NULL AND changeset IS NULL ) ),
1389
CHECK ( NOT ( branch IS NOT NULL AND changeset IS NOT NULL ) ),
1390
-- make sure, if we refer to a Product, that it is from
1392
FOREIGN KEY ( product, project ) REFERENCES Product ( id, project )
1399
1402
A PO File. This is a language-specific set of translations.
1401
1404
CREATE TABLE POFile (
1402
1405
id serial PRIMARY KEY,
1403
potemplate integer NOT NULL REFERENCES POTemplate,
1406
potemplate integer NOT NULL REFERENCES POTemplate,
1404
1407
language integer NOT NULL REFERENCES Language,
1406
1409
description text,
1408
1411
header text, -- the contents of the NULL msgstr
1409
1412
lasttranslator integer REFERENCES Person,
1410
1413
license integer REFERENCES License,
1411
-- the number of msgsets matched to the potemplate that have a
1412
-- non-fuzzy translation in the PO file when we last parsed it
1413
currentcount integer NOT NULL,
1414
-- the number of msgsets where we have a newer translation in
1415
-- rosetta than the one in the PO file when we last parsed it
1416
updatescount integer NOT NULL,
1417
-- the number of msgsets where we have a translation in rosetta
1418
-- but there was no translation in the PO file when we last parsed it
1419
rosettacount integer NOT NULL,
1420
-- the timestamp when we last parsed this PO file
1421
lastparsed timestamp,
1414
completeness integer, -- between 0 and 100
1422
1415
owner integer REFERENCES Person,
1423
1416
-- the number of plural forms needed to translate this
1505
1498
language integer NOT NULL REFERENCES Language,
1506
1499
potranslation integer NOT NULL REFERENCES POTranslation,
1507
1500
license integer NOT NULL REFERENCES License,
1508
dateprovided timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1509
datetouched timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1501
dateprovided timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1502
datetouched timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1510
1503
pluralform integer,
1511
1504
CHECK ( pluralform >= 0 )
1527
1520
language integer REFERENCES Language,
1528
1521
potranslation integer REFERENCES POTranslation,
1529
1522
commenttext text NOT NULL,
1530
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1523
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1531
1524
person integer REFERENCES Person
1538
The TranslationEffort table. Stores information about each active
1539
translation effort. Note, a translationeffort is an aggregation of
1540
resources. For example, the Gnome Translation Project, which aims to
1541
translate the PO files for many gnome applications. This is a point
1542
for the translation team to rally around.
1544
CREATE TABLE TranslationEffort (
1545
id serial PRIMARY KEY,
1546
owner integer NOT NULL REFERENCES Person,
1547
project integer NOT NULL REFERENCES Project,
1548
name text NOT NULL UNIQUE,
1549
title text NOT NULL,
1550
description text NOT NULL
1556
1531
TranslationeffortPOTemplateRelationship
1557
1532
A translation project incorporates a POTfile that is under translation.
1558
1533
The inheritance pointer allows this project to specify a custom
1561
1536
CREATE TABLE TranslationeffortPOTemplateRelationship (
1562
1537
translationeffort integer NOT NULL REFERENCES TranslationEffort ON DELETE CASCADE,
1563
potemplate integer NOT NULL REFERENCES POTemplate,
1564
-- see Translation Priority schema
1565
priority integer NOT NULL,
1538
potemplate integer NOT NULL REFERENCES POTemplate,
1566
1539
UNIQUE (translationeffort , potemplate)
1641
1614
explicit boolean NOT NULL,
1642
1615
-- see Bug Infestation Status schema
1643
1616
infestation integer NOT NULL,
1644
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1617
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1645
1618
creator integer NOT NULL REFERENCES Person,
1646
1619
dateverified timestamp,
1647
1620
verifiedby integer REFERENCES Person,
1648
lastmodified timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1621
lastmodified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1649
1622
lastmodifiedby integer NOT NULL REFERENCES Person,
1650
1623
PRIMARY KEY ( bug, coderelease )
1731
1704
bugreftype integer NOT NULL,
1732
1705
data text NOT NULL,
1733
1706
description text NOT NULL,
1734
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1707
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1735
1708
owner integer NOT NULL REFERENCES Person
1785
1758
bugsystem integer NOT NULL REFERENCES BugSystem,
1786
1759
remotebug text NOT NULL, -- unique identifier of bug in that system
1787
1760
remotestatus text NOT NULL, -- textual representation of status
1788
lastchanged timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1789
lastchecked timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1790
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1761
lastchanged timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1762
lastchecked timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1763
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1791
1764
owner integer NOT NULL REFERENCES Person
1827
BugAttachmentContent
1800
BugattachmentContent
1828
1801
The actual content of a bug attachment. There can be multiple
1829
1802
uploads over time, each revision gets a changecomment.
1831
CREATE TABLE BugAttachmentContent (
1832
id serial PRIMARY KEY,
1804
CREATE TABLE BugattachmentContent (
1833
1805
bugattachment integer NOT NULL REFERENCES BugAttachment,
1834
daterevised timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1806
daterevised timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1835
1807
changecomment text NOT NULL,
1836
1808
content bytea NOT NULL,
1837
filename text NOT NULL,
1839
owner integer REFERENCES Person
1810
owner integer REFERENCES Person,
1811
PRIMARY KEY ( bugattachment, daterevised )
1877
1849
CREATE TABLE BugMessage (
1878
1850
id serial PRIMARY KEY,
1879
1851
bug integer NOT NULL REFERENCES Bug,
1880
datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'),
1852
datecreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1881
1853
-- short title or subject of comment / message
1882
1854
title text NOT NULL,
1883
1855
-- the message or full email with headers