db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Marten Visser <jan.marten.vis...@virgil.nl>
Subject probleems with generating DDL for mySql
Date Wed, 26 Mar 2003 11:02:44 GMT

I seem to have a problem with generating columns with datatype 'TEXT'
for a mysql database:

I start with an sql file containing:

create table email_configuration
    round_no                  SMALLINT               not null,
    message                   TEXT              not null,
    days_after_previous       SMALLINT               not null,
    to_INS                    CHAR(3)                null    ,
    to_MAN                    CHAR(3)                null    ,
    to_CO                     CHAR(3)                null    ,
    cc_INS                    CHAR(3)                null    ,
    cc_MAN                    CHAR(3)                null    ,
    cc_CO                     CHAR(3)                null    ,
    primary key (round_no)

with ant (sql2xml) I create the xml containing:

<table name="email_configuration" javaName="EmailConfiguration"
    <column name="round_no" javaName="RoundNo" primaryKey="true"
required="true" type="INTEGER" />
    <column name="message" javaName="Message" required="false"
type="VARCHAR" />
    <column name="days_after_previous" javaName="DaysAfterPrevious"
required="true" type="INTEGER" />
    <column name="to_INS" javaName="ToIns" required="false"
type="VARCHAR" size="3" />
    <column name="to_MAN" javaName="ToMan" required="false"
type="VARCHAR" size="3" />
    <column name="to_CO" javaName="ToCo" required="false" type="VARCHAR"
size="3" />
    <column name="cc_INS" javaName="CcIns" required="false"
type="VARCHAR" size="3" />
    <column name="cc_MAN" javaName="CcMan" required="false"
type="VARCHAR" size="3" />
    <column name="cc_CO" javaName="CcCo" required="false" type="VARCHAR"
size="3" />

This is already beginning to look bad, because the column type "TEXT" in
the original .sql file has changed to 'VARCHAR' without a size. Also you
can see that the type 'SMALLINT' (which mysql knows) has changed to
'INTEGER' which mysql does not know.

If I create sql again I get:

CREATE TABLE email_configuration
        round_no INTEGER NOT NULL,
        message VARCHAR,
        days_after_previous INTEGER NOT NULL,
        to_INS VARCHAR (3),
        to_MAN VARCHAR (3),
        to_CO VARCHAR (3),
        cc_INS VARCHAR (3),
        cc_MAN VARCHAR (3),
        cc_CO VARCHAR (3),
    PRIMARY KEY(round_no)

So I have the dateformat 'VARCHAR' (with a size) which is not recognized
by mySql and the type "INTEGER" which is not recognized by mysql (should
be 'INT' or 'SMALLINT').

These are the relevant buildproperties:

torque.database.createUrl = jdbc:mysql://
torque.database.buildUrl = jdbc:mysql://
torque.database.url = jdbc:mysql://
torque.database.driver = com.mysql.jdbc.Driver

Anyone recognizes this problem and/or knows any solutions?



View raw message