Hello,
I want to use the schema update function to add two additional fields to an existing table in mysql. But it doesn't work.
I use
- MySQL 4.0.15
- Hibernate 2.1.2
- mysql-connector-java-3.0.11-stable-bin.jar
- Sun Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
- Suse Linux 9.0
The Ant-Task (net.sf.hibernate.tool.hbm2ddl.SchemaUpdateTask) runs successfull and creates a lot of create table and alter table statements, like:
Code:
...
[schemaupdate] create table SignatureTemplate (id BIGINT NOT NULL AUTO_INCREMENT, versionInDB BIGINT not null, fertigstellungsjahr INTEGER, hauptstudienrichtung VARCHAR(255), diplombereiche VARCHAR(255), forschungOderLehre VARCHAR(255), lastSequenzNummer BIGINT, anlass VARCHAR(255), primary key (id))
[schemaupdate] alter table Praxisdokumentation_AusgefTaetigkeit_Set add index (taetigkeit_id), add constraint FK7B0A110BD76D045B foreign key (taetigkeit_id) references Taetigkeit (id)
...
But the two additional fields are not added in the table.
The table I want to change is:
Code:
create table Arbeit (id BIGINT NOT NULL AUTO_INCREMENT, type VARCHAR(255) not null, versionInDB BIGINT not null, titel VARCHAR(255), untertitel VARCHAR(255), thema VARCHAR(255), abstrakt TEXT, fertigstellungsjahr INTEGER, hauptstudienrichtung_id BIGINT, anlass_id BIGINT, arbeitssignatur VARCHAR(255), mentor_id BIGINT, primary key (id))
The new table definition is:
Code:
create table Arbeit (id BIGINT NOT NULL AUTO_INCREMENT, type VARCHAR(255) not null, versionInDB BIGINT not null, titel VARCHAR(255), untertitel VARCHAR(255), thema VARCHAR(255), abstrakt TEXT, fertigstellungsjahr INTEGER, hauptstudienrichtung_id BIGINT, anlass_id BIGINT, arbeitssignatur VARCHAR(255), mentor_id BIGINT, von INTEGER, bis INTEGER, primary key (id))
So, the new fields are
- von
- bis
So, what can I do to add this two fields to the table "Arbeit"?
Any hints will be helpfull!
Regards
Oliver Nautsch