• 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: Paul Yu <email@hidden>
  • Date: Sun, 16 Dec 2012 11:36:46 -0500

This is just for the record.  Since my previous reply was bounced because of the wrong sent address.

I also use Theodore's approach at times.  I use my approach for more complex initial setups of the reference tables etc.

Paul
On Dec 16, 2012, at 9:51 AM, Paul Yu <email@hidden> wrote:

Instead of running a second migration.

What I do is this.  At the end of the initial migration .java file, I have this statement

    ERXJDBCUtilities.executeUpdateScriptFromResourceNamed(database.adaptorChannel(), "MigrationScripts/MyModel0_MySQL.migration", "MyModelFrameworkName");

Then in the

MyModelFrameworkName/Resources directory, I create a MigrationScripts directory and add the file MyModel0_MySQL.migration file.

In that file, I would have my INSERT statements to set the initial state of the database.

Paul

On Dec 16, 2012, at 9: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


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
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>)

  • Prev by Date: Re: Simple question: inserting data right after table creation (on migration?)
  • Next by Date: Re: D2W and ERAttachment
  • Previous by thread: Re: Simple question: inserting data right after table creation (on migration?)
  • Next by thread: Re: Simple question: inserting data right after table creation (on migration?)
  • Index(es):
    • Date
    • Thread