Hi Ted,
You can use EOF to set your values in migrations, so I guess you could set your
default values in your entity?
See Mike's example app SecretPal and the SecretPal0 migration postUpgrade
method. That might give you what you are looking for.
Also just recently someone (Ramsey?) posted that you can put default values in
your User Info Dictionary for the entity.
Before I found out about this approach I was using direct SQL statements (which
means that the migration may/will break across databases, so Mike's method is
better if you can do it).
@Override
public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase
database) throws Throwable {
ERXJDBCUtilities.executeUpdate(database.adaptorChannel(), "INSERT INTO Role
(roleDescription,id) VALUES ('Admin',1)", true);
}
Is this what you're after?
David
On 2012-04-18, at 12:33 PM, Theodore Petrosky wrote:
> When I create an attribute in Entity Modeler, and create the migrations, it
> does a beautiful job.
>
> creativeBriefTable.newFlagBooleanColumn("isfiled", false);
>
> and I know I can add a default value here
>
> creativeBriefTable.newFlagBooleanColumn("isfiled", false, false);
>
> problem is that if I go back and alter the schema and recreate the migration,
> I must remember to add in the default selector(s).
>
> I don't see in EM where I could put in a default value (or I am blind).
>
> Is there a place to put in a default value in Entity Modeler so the
> migrations it creates include the default value?
>
> Ted
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.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:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]