• 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: basic use of migrations with MySQL...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: basic use of migrations with MySQL...


  • Subject: Re: basic use of migrations with MySQL...
  • From: Ray Kiddy <email@hidden>
  • Date: Tue, 24 Jun 2014 13:21:17 -0700

On Tue, 24 Jun 2014 16:17:51 -0400
Theodore Petrosky <email@hidden> wrote:

> Ray,
>
> If I understand, (It always seems that I don’t understand the
> question), you want to alter a table through migrations. I have
> always done it like this.
>
>
> ERXMigrationTable theTable =
> database.existingTableNamed(“theTableIWantToAlter");
>
> theTable.existingColumnNamed(“theColumnName").setAllowsNull(false);
>
> Is this what you are looking for?
>
> Ted

This code:

ERXMigrationTable skuTable =
  database.existingTableNamed("product_skus");
skuTable.newStringColumn("tag", 63, true);

Generates this SQL:

alter table skus null column tag varchar(63);

- ray

> On Jun 24, 2014, at 3:59 PM, Ray Kiddy <email@hidden> wrote:
>
> >
> > I should have been using migrations for a long time, but I have
> > not. I have just never had the time to add another thing that might
> > break. But you know. But I thought I knew the theory of it.
> >
> > So, the only place I am seeing basic documentation on the
> > wocommunity site is in the page on creating an ERRest application.
> > Is this right? Did I miss something? I know there have been WOWODC
> > presentations, but that is not completely a replacement for a
> > simple how-to document.
> >
> > But starting out, migrations seemed pretty easy to use. Ok, setting
> > the encoding of the tables to latin1 instead of utf-8 was not
> > amazingly helpful, but I can deal.
> >
> > But then I tried my first table change, as opposed to a create.
> >
> >    alter table foo_table null column1 column2 varchar(10);
> >
> > Hm. Not helpful. I guess falling back to reasonable defaults is not
> > what happens here. I tried adding things to my classpath, such as
> > the Wonder MySQL plugin framework. No difference.
> >
> > So, I now use my migration java sources as a convenient place for
> > the comments which give me the SQL I have to execute manually to
> > make this work. This is probably not the best use of this feature,
> > though.
> >
> > Any obvious things I am missing before I try to debug this and,
> > perhaps, put some basic documentation on the site?
> >
> > thanx - ray



 _______________________________________________
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: basic use of migrations with MySQL...
      • From: Theodore Petrosky <email@hidden>
References: 
 >basic use of migrations with MySQL... (From: Ray Kiddy <email@hidden>)
 >Re: basic use of migrations with MySQL... (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: basic use of migrations with MySQL...
  • Next by Date: Re: basic use of migrations with MySQL...
  • Previous by thread: Re: basic use of migrations with MySQL...
  • Next by thread: Re: basic use of migrations with MySQL...
  • Index(es):
    • Date
    • Thread