[Buildbot-devel] DB structure issue?

Galina Kistanova gkistanova at gmail.com
Tue Sep 18 19:18:57 UTC 2012


Hello everyone,

I was closely looking at the data structure the nine branch creates
for Sqlite, and noticed that it creates wrong foreign key constraint.
Here is the issue:

CREATE TABLE buildsets (
        id INTEGER NOT NULL,
        external_idstring VARCHAR(256),
        reason VARCHAR(256),
        sourcestampsetid INTEGER NOT NULL,
        submitted_at INTEGER NOT NULL,
        complete SMALLINT DEFAULT '0' NOT NULL,
        complete_at INTEGER,
        results SMALLINT,
        PRIMARY KEY (id),
        FOREIGN KEY(sourcestampsetid) REFERENCES sourcestamps (id),
        FOREIGN KEY(sourcestampsetid) REFERENCES sourcestampsets (id)


The first FOREIGN KEY is wrong (i.e. FOREIGN KEY(sourcestampsetid)
REFERENCES sourcestamps (id)).

I have tracked it down to the 018_add_sourcestampset.py migrate
script. It renames the column name and adds a new foreign key
constraint, but doesn't remove the existing one.

Is this a known bug?

Thanks

Galina




More information about the devel mailing list