Below is my table creation from my migration .java. I used the example from the
SooperSeekrit tutorial. my problem is the insert statement at the bottom. After
I run the app, I check the postgresql database and there are two entries...
assoftwareassets=# select * from t_manufacturer;
c_as_account_number | c_manufacturer_name | c_vendor_phone_number | id |
c_notes
---------------------+---------------------+-----------------------+----+---------
| Quark | | 1 |
| Quark | | 2 |
Why are there two rows of data? I only inserted one.
Ted
ERXMigrationTable manufacturerTable = database.newTableNamed("t_manufacturer");
manufacturerTable.newStringColumn("c_as_account_number", 255, true);
manufacturerTable.newIntegerColumn("id", false);
manufacturerTable.newStringColumn("c_manufacturer_name", 255, false);
manufacturerTable.newStringColumn("c_vendor_phone_number", 16, true);
manufacturerTable.create();
manufacturerTable.setPrimaryKey("id");
ERXMigrationTable assetTable = database.newTableNamed("t_asset");
assetTable.newIntegerColumn("id", false);
assetTable.newIntegerColumn("manufacturer_id", false);
assetTable.newStringColumn("c_serial_number", 255, true);
assetTable.newStringColumn("c_title", 255, true);
assetTable.create();
assetTable.setPrimaryKey("id");
assetTable.addForeignKey("manufacturer_id", "t_manufacturer", "id");
ERXJDBCUtilities.executeUpdate(database.adaptorChannel(), "INSERT INTO
t_manufacturer (c_manufacturer_name) VALUES ('Quark')");
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]