• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Simple question: inserting data right after table creation (on migration?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple question: inserting data right after table creation (on migration?)


  • Subject: Re: Simple question: inserting data right after table creation (on migration?)
  • From: Flavio Donadio <email@hidden>
  • Date: Sun, 16 Dec 2012 23:21:31 -0200

Johnny,


Thanks a lot! Your technique seems to be the most elegant... I'm modifying my code right now.

And I see I'm not the only one that got help from this. Nice!


Regards,
Flavio

On 16/12/2012, at 18:45, Johnny Miller wrote:

> You can also make your migration file implement: IERXPostMigration
>
> So in your normal migration do your database changes and then in public void postUpgrade(EOEditingContext editingContext, EOModel model) do your inserts.
>
> Aloha,
> Mr. Johnny Miller
> Web Development Manager
> Kahalawai Media Company
> Lahaina, HI 96761
> tel: (808) 661-7962 | mobile: (808) 283-0791
> website | e-mail
>
> On Dec 16, 2012, at 4:34 AM, James Cicenia <email@hidden> wrote:
>
>> I have always created a second migration file with SQL inserts. Haven't experienced any problems.
>>
>> DateModel0 ==> setup tables, etc.
>> DateModel1 ==> bootstrap data sql inserts
>>
>>
>>
>> On Dec 16, 2012, at 8:23 AM, Flavio Donadio <email@hidden> wrote:
>>
>>> Hello, people!
>>>
>>>
>>> I think I already know the answer, but I need to check first...
>>>
>>> I want to create a default user on my WO App when the app is first run. So, I need to create a User entity and insert it right after my tables are created, which is automatically done through a migration.
>>>
>>> Is it safe to insert my code right after this?
>>>
>>> 	userTable.create();
>>> 	userTable.setPrimaryKey("id");
>>>
>>> Or would I need something else? Is this right, optimal and/or safe?
>>>
>>>
>>> Regards,
>>> Flavio
>>> _______________________________________________
>>> 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
>>
>> _______________________________________________
>> 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
>


 _______________________________________________
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

  • Follow-Ups:
    • Connection validation, auto reconnect
      • From: JR Ruggentaler <email@hidden>
References: 
 >Simple question: inserting data right after table creation (on migration?) (From: Flavio Donadio <email@hidden>)
 >Re: Simple question: inserting data right after table creation (on migration?) (From: James Cicenia <email@hidden>)
 >Re: Simple question: inserting data right after table creation (on migration?) (From: Johnny Miller <email@hidden>)

  • Prev by Date: Re: Simple question: inserting data right after table creation (on migration?)
  • Next by Date: Migrations problem with FrontBase
  • Previous by thread: Re: Simple question: inserting data right after table creation (on migration?)
  • Next by thread: Connection validation, auto reconnect
  • Index(es):
    • Date
    • Thread