I'm afraid I am using an older version. I  will update it tomorrow. Hopefully 
this will resolve the issue. 

Thanks,

Farrukh

Sent from my iPhone

On 2010-09-18, at 11:40 PM, Mike Schrag <[email protected]> wrote:

> are you using an up-to-date postgresql plugin from Wonder?
> 
> in PostgresqlExpression:
>     public void addCreateClauseForAttribute(EOAttribute attribute) {
>       NSDictionary userInfo = attribute.userInfo();
>       Object defaultValue = null;
>       if (userInfo != null) {
>         defaultValue = 
> userInfo.valueForKey("er.extensions.eoattribute.default");
>       }
>       String allowsNullClauseForConstraint = 
> allowsNullClauseForConstraint(shouldAllowNull(attribute));
>       String sql;
>       if (defaultValue == null) {
>           sql = 
> _NSStringUtilities.concat(this.quoteIdentifier(attribute.columnName()), " ", 
> columnTypeStringForAttribute(attribute), " ", allowsNullClauseForConstraint);
>       }
>       else {
>           sql = 
> _NSStringUtilities.concat(this.quoteIdentifier(attribute.columnName()), " ", 
> columnTypeStringForAttribute(attribute), " DEFAULT ", 
> formatValueForAttribute(defaultValue, attribute), " ", 
> allowsNullClauseForConstraint);
>       }
>       appendItemToListString(sql, _listString());
>     }
> 
> the "er.extensions.eoattribute.default" is injected into the attribute 
> userInfo by migrations ... you can add some debug to this method and see what 
> is going on, but i'm pretty sure this works.
> 
> ms
> 
> On Sep 18, 2010, at 4:37 PM, Farrukh Ijaz wrote:
> 
>> Hi Mike,
>> 
>> Thanks for your prompt reply. We are using Postgresql and I am talking about 
>> the SQL insert statement which gives me error when I execute using Aqua 
>> Studio or PSQL tool.
>> 
>> Do you think I am missing something? Well this is not a show stopper and I 
>> can create an extra version to execute DDL script to set default values.
>> 
>> Farrukh
>> 
>> Sent from my iPhone
>> 
>> On 2010-09-18, at 11:28 PM, Mike Schrag <[email protected]> wrote:
>> 
>>> default values is not supported by eof directly ... it's up to your 
>>> database plugin to support wonder's extension for this to work. currently i 
>>> believe only frontbase and postgresql migrations support this.
>>> 
>>> ms
>>> 
>>> On Sep 18, 2010, at 4:17 PM, Farrukh Ijaz wrote:
>>> 
>>>> 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 protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> http://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com
>>>> 
>>>> This email sent to [email protected]
>>> 
>>> _______________________________________________
>>> 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/farrukh.ijaz%40fuegodigitalmedia.com
>>> 
>>> This email sent to [email protected]
> 
> _______________________________________________
> 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/farrukh.ijaz%40fuegodigitalmedia.com
> 
> This email sent to [email protected]
 _______________________________________________
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]

Reply via email to