db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Einsle <rob...@einsle.de>
Subject Problems using autoIncrement with primary Key
Date Wed, 23 Nov 2005 13:23:44 GMT
Hy List,

i have an another Problem using DDL-Utils.

The Base XML-Document is:

--- cut ---
  <database name="re_test">
    <table name="arbeitstage">
      <column name="jahr" primaryKey="true" required="true" 
type="BIGINT" size="8" autoIncrement="true" />
      <column name="monat" primaryKey="true" required="true" 
type="SMALLINT" size="2" autoIncrement="true" />
      <column name="tage" required="true" type="BIGINT" size="8" />
      <column name="feiertage" required="true" type="BIGINT" size="8" />
      <column name="wochenende" required="true" type="BIGINT" size="8" />
      <column name="arbeitstage" required="true" type="BIGINT" size="8" />
      <column name="monat_zahl" required="true" type="BIGINT" size="8" />
    </table>
    <table name="drucken">
      <column name="id" primaryKey="true" required="true" type="INTEGER" 
size="4" autoIncrement="true" />
      <column name="datum" required="true" type="DATE" size="4" />
      <column name="pers_nr" required="true" type="VARCHAR" size="50" />
      <column name="uhrzeit" required="true" type="VARCHAR" size="50" />
      <column name="zeiten" required="true" type="NUMERIC" size="4,2" />
      <column name="beschreibung" required="true" type="VARCHAR" 
size="2000" />
      <column name="abrechnung" required="false" type="BIT" size="1" />
      <column name="abgerechnet" required="false" type="BIT" size="1" />
      <!-- <foreign-key foreignTable="rechnung">
        <reference local="id" foreign="id"/>
      </foreign-key>  -->
    </table>
  </database>
--- cut ---

this generates me two Tables:

--- cut ---
CREATE TABLE arbeitstage
(
  jahr int8 NOT NULL DEFAULT nextval('arbeitstage_jahr_seq'::regclass),
  monat int2 NOT NULL DEFAULT nextval('arbeitstage_monat_seq'::regclass),
  tage int8 NOT NULL,
  feiertage int8 NOT NULL,
  wochenende int8 NOT NULL,
  arbeitstage int8 NOT NULL,
  monat_zahl int8 NOT NULL,
  CONSTRAINT arbeitstage_jahr_key UNIQUE (jahr),
  CONSTRAINT arbeitstage_monat_key UNIQUE (monat)
) ;
CREATE TABLE drucken
(
  id int4 DEFAULT nextval('drucken_id_seq'::regclass),
  datum date NOT NULL,
  pers_nr varchar(50) NOT NULL,
  uhrzeit varchar(50) NOT NULL,
  zeiten numeric(4,2) NOT NULL,
  beschreibung varchar(2000) NOT NULL,
  abrechnung bool,
  abgerechnet bool,
  CONSTRAINT drucken_id_key UNIQUE (id)
) ;
--- cut ---

if i remove the autoIncrement Statements, then the Primary Keys are 
created, of not, only Unique Keys are created.

Where is the Error?

Thanks

Greetings

Robert



Mime
View raw message