You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Andrew <Aw...@smumn.edu> on 2002/03/01 11:38:48 UTC

Help with editing the Schema.xml

First off is there any full documentation of what syntax turbine does does not 
allow? Maybe a Schema manual?

Alright, now on with the questions at hand. I have an existing mysql database. 
Running the Ant task JDBC-->XML does not handle all aspects of the schema 
generation. Thus some questions:

1) Is the equivelent of a AKA field created by the following:
        <column default="" name="Name" required = "true" size="10" 
type="VARCHAR"/>
        <unique>
            <unique-column name="Name"/>
        </unique>

2) Is 'required=true' equivalent to 'NOT NULL' in SQL?

3) How to define UNIQUE constraints across multiple columns? Will this work:
        <unique>
            <unique-column name="Relation 1"/>
            <unique-column name="Relation 2"/>
            <unique-column name="Date"/>
        </unique>

4) Can you define multiple Foreign key mappings as follows:
        <foreign-key foreignTable="address">
            <reference
                local="address_id"
                foreign="id"/>
            <reference
                local="address_type"
                foreign="type"/>
        </foreign-key>

5) Are primaryKeys which cross multiple columns allowed?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Help with editing the Schema.xml

Posted by Heiko Braun <he...@hlan.org>.
Hi,

take a look at the source distribution.
its available via cvs.

	-> /jakarta-turbine/src/dtd/database.dtd

the dtd will answers most of your questions.

> 1) Is the equivelent of a AKA field created by the following:
>         <column default="" name="Name" required = "true" size="10" 
> type="VARCHAR"/>
>         <unique>
>             <unique-column name="Name"/>
>         </unique>
> 

a AKA field?

> 2) Is 'required=true' equivalent to 'NOT NULL' in SQL?
yup

> 
> 3) How to define UNIQUE constraints across multiple columns? Will this work:
>         <unique>
>             <unique-column name="Relation 1"/>
>             <unique-column name="Relation 2"/>
>             <unique-column name="Date"/>
>         </unique>
> 
yup

> 4) Can you define multiple Foreign key mappings as follows:
>         <foreign-key foreignTable="address">
>             <reference
>                 local="address_id"
>                 foreign="id"/>
>             <reference
>                 local="address_type"
>                 foreign="type"/>
>         </foreign-key>
> 
yup

> 5) Are primaryKeys which cross multiple columns allowed?
yup.
 
although i dont now how they are specified in schema.xml.;) 
i did it manually.

hth,
heiko


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Help with editing the Schema.xml

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: Andrew <Aw...@smumn.edu>
> 
> First off is there any full documentation of what syntax turbine does does not
> allow? Maybe a Schema manual?
> 
database.dtd - you should include this in a doctype declaration at the top
of your schema files.  From memory, the correct URL is:
http://jakarta.apache.org/turbine/dtd/database.dtd

Note that this is missing, commented out and/or incorrect in the schema
files included in the tdk 2.1

HTH,

Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>