Migrations and Default Values
Migrations and Default Values
- Subject: Migrations and Default Values
- From: Farrukh Ijaz <email@hidden>
- Date: Sat, 18 Sep 2010 23:17:50 +0300
Hi,
I've noticed that MIgrations code does not respect the default values specified. E.g. Following code creates a database table called CALENDAR.
ERXMigrationTable calendarTable = database.newTableNamed("CALENDAR"); calendarTable.newStringColumn("CAL_DESC", 512, true); calendarTable.newStringColumn("CAL_NAME", 64, false); calendarTable.newIntegerColumn("IS_PUBLIC", false, 0); calendarTable.newIntegerColumn("OID", false); calendarTable.create(); calendarTable.setPrimaryKey("OID");
Technically this should set the column to set the default value to 0 for IS_PUBLIC column whenever a record is inserted in this table. But this is not the case, inspecting the table structure tells there is no default value set for this column and inserting a new record in this table without explicitly specifying the is_public value to 0, it gives Not Null sql exception.
Any comments?
Farrukh |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden