continuum-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Venisse <emmanuel.veni...@gmail.com>
Subject Re: Data Management export and import for 1.2.x -> 1.3.x ... do I really have to?
Date Wed, 11 Feb 2009 13:00:27 GMT
The diff between Continuum-1.2.2 and 1.3.1 generated by liquibase (1.8.1) is
the following:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.8"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.liquibase.org/xml/ns/dbchangelog/1.8
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.8.xsd">
    <changeSet author="evenisse (generated)" id="1234350082131-1">
        <createTable tableName="BUILDQUEUE">
            <column name="ID" type="INTEGER">
                <constraints nullable="false" primaryKey="true"
primaryKeyName="BUILDQUEUE_PK"/>
            </column>
            <column name="MODEL_ENCODING" type="VARCHAR(255)"/>
            <column name="NAME" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-2">
        <createTable tableName="PROJECTSCMROOT">
            <column name="ID" type="INTEGER">
                <constraints nullable="false" primaryKey="true"
primaryKeyName="PROJECTSCMROOT_PK"/>
            </column>
            <column name="ERROR" type="VARCHAR(8192)"/>
            <column name="MODEL_ENCODING" type="VARCHAR(255)"/>
            <column name="OLD_STATE" type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="PROJECT_GROUP_ID_OID" type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="SCM_ROOT_ADDRESS" type="VARCHAR(255)">
                <constraints nullable="false"/>
            </column>
            <column name="SCMROOTSTATE" type="INTEGER">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-3">
        <createTable tableName="SCHEDULE_BUILDQUEUES">
            <column name="ID_OID" type="INTEGER">
                <constraints nullable="false"/>
            </column>
            <column name="ID_EID" type="INTEGER"/>
            <column name="INTEGER_IDX" type="INTEGER">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-4">
        <addColumn tableName="PROJECT">
            <column name="SCM_RESULT_SCMRESULT_ID_OID" type="BIGINT"/>
        </addColumn>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-5">
        <addColumn tableName="PROJECTNOTIFIER">
            <column name="SEND_ON_SCM_FAILURE" type="CHAR(1)"/>
        </addColumn>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-6">
        <addColumn tableName="SYSTEMCONFIGURATION">
            <column name="DISTRIBUTED_BUILD_ENABLED" type="CHAR(1)"/>
        </addColumn>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-7">
        <addColumn tableName="SYSTEMCONFIGURATION">
            <column name="NUMBER_OF_BUILDS_IN_PARALLEL" type="INTEGER"/>
        </addColumn>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-8">
        <addPrimaryKey columnNames="ID_OID, INTEGER_IDX"
constraintName="SCHEDULE_BUIL8T_PK" tableName="SCHEDULE_BUILDQUEUES"/>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-9">
        <addForeignKeyConstraint
baseColumnNames="SCM_RESULT_SCMRESULT_ID_OID" baseTableName="PROJECT"
constraintName="PROJECT_FK4" deferrable="false" initiallyDeferred="false"
referencedColumnNames="SCMRESULT_ID" referencedTableName="SCMRESULT"/>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-10">
        <addForeignKeyConstraint baseColumnNames="PROJECT_GROUP_ID_OID"
baseTableName="PROJECTSCMROOT" constraintName="PROJECTSCMROOT_FK1"
deferrable="false" initiallyDeferred="false" referencedColumnNames="ID"
referencedTableName="PROJECTGROUP"/>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-11">
        <addForeignKeyConstraint baseColumnNames="ID_EID"
baseTableName="SCHEDULE_BUILDQUEUES" constraintName="SCHEDULE_BUIMA_FK2"
deferrable="false" initiallyDeferred="false" referencedColumnNames="ID"
referencedTableName="BUILDQUEUE"/>
    </changeSet>
    <changeSet author="evenisse (generated)" id="1234350082131-12">
        <addForeignKeyConstraint baseColumnNames="ID_OID"
baseTableName="SCHEDULE_BUILDQUEUES" constraintName="SCHEDULE_BUIMA_FK1"
deferrable="false" initiallyDeferred="false" referencedColumnNames="ID"
referencedTableName="SCHEDULE"/>
    </changeSet>
</databaseChangeLog>


The partial sql for these changesets is:

-- Changeset dbchanges.xml::1234350523950-1::evenisse (generated)::(MD5Sum:
32a19089ed6cae98dc98b71532d536d4)

CREATE TABLE BUILDQUEUE (ID INTEGER NOT NULL, MODEL_ENCODING VARCHAR(255),
NAME VARCHAR(255) NOT NULL, CONSTRAINT BUILDQUEUE_PK PRIMARY KEY (ID));

-- Changeset dbchanges.xml::1234350523950-2::evenisse (generated)::(MD5Sum:
2b18cfd1e86c99f43518f81fc993a83)
CREATE TABLE PROJECTSCMROOT (ID INTEGER NOT NULL, ERROR VARCHAR(8192),
MODEL_ENCODING VARCHAR(255), OLD_STATE INTEGER NOT NULL,
PROJECT_GROUP_ID_OID INTEGER NOT NULL, SCM_ROOT_ADDRESS VARCHAR(255) NOT
NULL, SCMROOTSTATE INTEGER NOT NULL, CONSTRAINT PROJECTSCMROOT_PK PRIMARY
KEY (ID));

-- Changeset dbchanges.xml::1234350523950-3::evenisse (generated)::(MD5Sum:
bcd8289fc7516aa71faf3e8ba070a)
CREATE TABLE SCHEDULE_BUILDQUEUES (ID_OID INTEGER NOT NULL, ID_EID INTEGER,
INTEGER_IDX INTEGER NOT NULL);

-- Changeset dbchanges.xml::1234350523950-4::evenisse (generated)::(MD5Sum:
74a99c58f92f413bf96b1b67c6f331)
ALTER TABLE PROJECT ADD SCM_RESULT_SCMRESULT_ID_OID BIGINT;

-- Changeset dbchanges.xml::1234350523950-5::evenisse (generated)::(MD5Sum:
bbc43a48f0b57b643b1ed99f369b3e55)

ALTER TABLE PROJECTNOTIFIER ADD SEND_ON_SCM_FAILURE CHAR(1);

-- Changeset dbchanges.xml::1234350523950-6::evenisse (generated)::(MD5Sum:
15d5b919e8b160ded2af173acf4c22ac)

ALTER TABLE SYSTEMCONFIGURATION ADD DISTRIBUTED_BUILD_ENABLED CHAR(1);

-- Changeset dbchanges.xml::1234350523950-7::evenisse (generated)::(MD5Sum:
50eddbe1458822ae90504c4a87aa3ae9)

ALTER TABLE SYSTEMCONFIGURATION ADD NUMBER_OF_BUILDS_IN_PARALLEL INTEGER;

-- Changeset dbchanges.xml::1234350523950-8::evenisse (generated)::(MD5Sum:
b142a1e3ab7d6bb326367ba92193d0)
ALTER TABLE SCHEDULE_BUILDQUEUES ADD CONSTRAINT SCHEDULE_BUIL8T_PK PRIMARY
KEY (ID_OID, INTEGER_IDX);

-- Changeset dbchanges.xml::1234350523950-9::evenisse (generated)::(MD5Sum:
8736686c9af81ee33de2f41e95f545)
ALTER TABLE PROJECT ADD CONSTRAINT PROJECT_FK4 FOREIGN KEY
(SCM_RESULT_SCMRESULT_ID_OID) REFERENCES SCMRESULT(SCMRESULT_ID);

-- Changeset dbchanges.xml::1234350523950-10::evenisse (generated)::(MD5Sum:
da19facd1cefbd4e9fdfb01883a886)
ALTER TABLE PROJECTSCMROOT ADD CONSTRAINT PROJECTSCMROOT_FK1 FOREIGN KEY
(PROJECT_GROUP_ID_OID) REFERENCES PROJECTGROUP(ID);

-- Changeset dbchanges.xml::1234350523950-11::evenisse (generated)::(MD5Sum:
cb111ee190e8e9d3290a3a4d476f89)
ALTER TABLE SCHEDULE_BUILDQUEUES ADD CONSTRAINT SCHEDULE_BUIMA_FK2 FOREIGN
KEY (ID_EID) REFERENCES BUILDQUEUE(ID);

-- Changeset dbchanges.xml::1234350523950-12::evenisse (generated)::(MD5Sum:
a9c5b14ba1e967f33f4baf72fded833)

ALTER TABLE SCHEDULE_BUILDQUEUES ADD CONSTRAINT SCHEDULE_BUIMA_FK1 FOREIGN
KEY (ID_OID) REFERENCES SCHEDULE(ID);

Maybe it can help you to understand db schema change. For a correct update,
I think we need to populate some table/column but it's a start.

Emmanuel

On Tue, Feb 10, 2009 at 10:33 PM, Wendy Smoak <wsmoak@gmail.com> wrote:

> On Thu, Feb 5, 2009 at 4:04 PM, Wendy Smoak <wsmoak@gmail.com> wrote:
>
> > ISTR someone (Brett?) saying that the only problematic change is a new
> > column that is required and has no default value.
> >
> > Can anyone confirm or deny?  If it's true, which one is it and what
> > would I need to modify in a 1.2.x database to make it usable with
> > 1.3.1?
>
> When upgrading from 1.2.x to 1.3.1, trying to use an existing database
> results in:
>
> SQL Exception: In an ALTER TABLE statement, the column
> 'NUMBER_OF_BUILDS_IN_PARALLEL' has been specified as NOT NULL and
> either the DEFAULT clause was not specified or was specified as
> DEFAULT NULL.
>
> However when I look at the model [1] I see...
>
>        <field>
>          <name>numberOfBuildsInParallel</name>
>          <version>1.1.4+</version>
>          <type>int</type>
>          <defaultValue>1</defaultValue>
>        </field>
>
> It looks like there's a default value to me... (and it does default to
> 1 in the Web interface.)  Does anyone have an idea why JDO isn't able
> to modify the table?
>
> I don't think I'm willing to try modifying the database for an upgrade
> to 1.3.1, but it would be nice to improve this for 1.3.2+.
>
> [1]
> http://svn.apache.org/repos/asf/continuum/tags/continuum-1.3.1/continuum-model/src/main/mdo/continuum.xml
>
> --
> Wendy
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message