• 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: migrations and boolean values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: migrations and boolean values


  • Subject: Re: migrations and boolean values
  • From: Theodore Petrosky <email@hidden>
  • Date: Fri, 5 Sep 2008 20:16:33 -0700 (PDT)

Ok... I finally got around to trying this and no joy...

newEntityTable.newBooleanColumn("newAttribute", false);


 it creates (from psql):

newattribute | character varying(5) | not null

Maybe there is no way to create a boolean value using Migrations. (Maybe there is if I could fix it but I don't have the skill set.)

Thanks anyway.

Ted


--- On Sat, 8/30/08, Mitchell Smith <email@hidden> wrote:

> From: Mitchell Smith <email@hidden>
> Subject: Re: migrations and boolean values
> To: email@hidden
> Date: Saturday, August 30, 2008, 1:51 PM
> Hi,
>
> We had this very same issue in a recent project, and we
> ended up using
> varchar fields for the Boolean columns, mainly because that
> is how it is
> done when prototyping for Frontbase, so we jsut carried
> that same logic
> through to Postgres.
>
> However, you can generate a bool field in your migration
> with something
> like:
>
> PeopleTable.newBooleanColumn(name, allowsNull)
>
> Which creates a colum of type "bool" in Postgres.
>
> We did run in to some problems when modeling this column
> type to a Boolean C
> however.
>
> I hope this helps.
>
> Cheers,
>
> Mitch
>
>
> ----- Original Message -----
> From: <email@hidden>
> To: <email@hidden>
> Sent: Thursday, August 28, 2008 12:59 AM
> Subject: migrations and boolean values
>
>
> >I am trying to use migrations to set up a boolean data
> type column in
> >postgresql. I have tried:
> >
> > peopleTable.newColumn("c_isactive",
> java.sql.Types.BOOLEAN, 0, 0, 0, true,
> > "");
> >
> > or:
> >
> > peopleTable.newColumn("c_isactive", 16, 0,
> 0, 0, true, "");
> >
> > when I examine the pg table, c_isactive is a bytea
> data type.
> >
> > maybe there is no way to get to the boolean type?
> >
> > what I'm looking for is:
> >
> > CREATE TABLE t_people (c_isactive bool, c_note text);
> >
> > any ideas what I am doing wrong. also interesting,
> when I google on
> > java.sql.Types, there is no boolean type listed in any
> of the referenced
> > pages.
> >
> > I'd love to hear that I am just doing something
> wrong.
> >
> > Ted
> >
> >
> >
> > _______________________________________________
> > 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:
    • Re: migrations and boolean values
      • From: Guido Neitzer <email@hidden>
  • Prev by Date: Re: Cappuccino
  • Next by Date: Apache 2.2.9 + WebObjects configuration issue...
  • Previous by thread: Fwd: Cappuccino
  • Next by thread: Re: migrations and boolean values
  • Index(es):
    • Date
    • Thread