Hi

 

Is there a way with the generator to create new tables that have foreign key
that reference already existing tables?

 

E.g. I have a database where the tables Product  (primary key product_id)
and Client (primary key client_id) already exists. 

Now I want to use the generator to create a joined table Product_Client that
have two foreign keys

So my xml would look like

  <table idMethod="native" name="Product_Client">

    <column name="product_client_id" primaryKey="true" required="true"
type="INTEGER"/>

    <column name="product_id" required="true" type="INTEGER"/>

    <column name="client_id" required="true" type="INTEGER"/>

        <foreign-key foreignTable="Client">

            <reference foreign="client_id" local="client_id"/>

        </foreign-key>

        <foreign-key foreignTable="Product">

            <reference foreign="product_id" local="product_id"/>

        </foreign-key>

  </table>

 

Torque doesn't like it when generating the sql as it doesn't find the
referenced tables. Could there be an option in Torque where it just
generates a warning that the table does not exist but still create the sql?

 

 

Reply via email to