• 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
Migrations and Default Values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Migrations and Default Values


  • Subject: Migrations and Default Values
  • From: Farrukh Ijaz <email@hidden>
  • Date: Sat, 18 Sep 2010 23:17:50 +0300

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Migrations and Default Values
      • From: Mike Schrag <email@hidden>
  • Prev by Date: Re: ERModernDirectToWeb SortButton
  • Next by Date: Re: Migrations and Default Values
  • Previous by thread: Re: ERPPieChart pie piece color
  • Next by thread: Re: Migrations and Default Values
  • Index(es):
    • Date
    • Thread