• 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
updating using Migrations with allowNull
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

updating using Migrations with allowNull


  • Subject: updating using Migrations with allowNull
  • From: Theodore Petrosky <email@hidden>
  • Date: Fri, 21 Mar 2014 08:24:33 -0400

I have a running D2W app and I need to add some booleans to my User.security Entity.

Normally I accomplish this by:

adding the boolean to my postgresql db with migrations:

     ERXMigrationTable securityTable = database.existingTableNamed("security");
     securityTable.newFlagBooleanColumn("canseeprojects", true);

(I am setting allowsNull to true even thought I want it to be false. )

then I update the security's new attribute to false for current security entries, and change the table to not allowsNull:

    /*
     * Fix the canseeprojects boolean
     */
     ERXJDBCUtilities.executeUpdate(database.adaptorChannel(),   "UPDATE security SET canseeprojects = false");

     securityTable.existingColumnNamed("canseeprojects").setAllowsNull(false);


Is there an easier way, or is this just an artifact to live with?
 _______________________________________________
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:
    • Re: updating using Migrations with allowNull
      • From: David Avendasora <email@hidden>
  • Prev by Date: Re: Application not start in womonitor
  • Next by Date: Re: updating using Migrations with allowNull
  • Previous by thread: Re: Application not start in womonitor
  • Next by thread: Re: updating using Migrations with allowNull
  • Index(es):
    • Date
    • Thread