Hi,
I made a short code example, based on following schema:
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "litesql.dtd">
<database name="DatabaseLiteSql" namespace="ormlitesql">
<object name="Point">
<field name="x" type="float" default="0"/>
<field name="y" type="float" default="0"/>
<field name="z" type="float" default="0"/>
</object>
<object name="Material">
<field name="name" type="string"/>
<field name="density" type="float"/>
</object>
<object name="Section">
<field name="name" type="string"/>
</object>
<object name="Beam"/>
<relation name="SectionMaterial">
<relate object="Material" handle="section" limit="one" />
<relate object="Section" handle="material" limit="one"/>
</relation>
<relation name="SectionPoints" unidir="true">
<relate object="Point" limit="many" handle="section"/>
<relate object="Section" limit="one" handle="points"/>
</relation>
<relation name="BeamPoints">
<relate object="Point" limit="many" handle="beams"/>
<relate object="Beam" limit="many" handle="points"/>
</relation>
<relation name="BeamSections">
<relate object="Section" limit="one" handle="beams"/>
<relate object="Beam" limit="many" handle="section"/>
</relation>
</database>
Everything worked fine till I decided to change the previous schema,
adding a new field in the Point object, so the schema became the following:
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "litesql.dtd">
<database name="DatabaseLiteSql" namespace="ormlitesql">
<object name="Point">
<field name="x" type="float" default="0"/>
<field name="y" type="float" default="0"/>
<field name="z" type="float" default="0"/>
<field name="h" type="float" default="1"/>
</object>
<object name="Material">
<field name="name" type="string"/>
<field name="density" type="float"/>
</object>
<object name="Section">
<field name="name" type="string"/>
</object>
<object name="Beam"/>
<relation name="SectionMaterial">
<relate object="Material" handle="section" limit="one" />
<relate object="Section" handle="material" limit="one"/>
</relation>
<relation name="SectionPoints" unidir="true">
<relate object="Point" limit="many" handle="section"/>
<relate object="Section" limit="one" handle="points"/>
</relation>
<relation name="BeamPoints">
<relate object="Point" limit="many" handle="beams"/>
<relate object="Beam" limit="many" handle="points"/>
</relation>
<relation name="BeamSections">
<relate object="Section" limit="one" handle="beams"/>
<relate object="Beam" limit="many" handle="section"/>
</relation>
</database>
After that I ran my code example, using an existing postgresql DB
(created with the first schema), but when the "upgrade" function was
invoked this exception was raised:
Query:ALTER TABLE Point_backup ADD COLUMN h_; failed: ERROR: syntax
error at or near ";"
LINE 1: ALTER TABLE Point_backup ADD COLUMN h_;
Probably postgresql needs the field type of new column, instead using
sqlite3 db everything works fine. Can anyone tell me how can I solve
this problem?
Thanks in advance for you reply.
Giovanni.
Nessun virus nel messaggio in uscita.
Controllato da AVG - www.avg.com
Versione: 9.0.730 / Database dei virus: 270.14.150/2632 - Data di rilascio:
01/19/10 08:34:00
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Litesql-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/litesql-users