Account Options

  1. Sign in
Google Groups Home
« Groups Home
Migration: updating a column
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Yen  
View profile  
 More options Jul 29 2010, 9:03 am
From: Eric Yen <e...@ericyen.com>
Date: Thu, 29 Jul 2010 06:03:53 -0700 (PDT)
Local: Thurs, Jul 29 2010 9:03 am
Subject: Migration: updating a column
Hi,

Is there a way to "update" a column?

Here's what I mean:
I have a column name "item" in table "products" of type "integer"
Now I want to update the  column to have the option ":null => false"

So far, the only way I have found is to remove it and re-add it, but
obviously that is quite dumb.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ar Chron  
View profile  
 More options Jul 29 2010, 9:19 am
From: Ar Chron <li...@ruby-forum.com>
Date: Thu, 29 Jul 2010 15:19:23 +0200
Local: Thurs, Jul 29 2010 9:19 am
Subject: Re: Migration: updating a column
Have you tried change_column in a migration?

http://api.rubyonrails.org/classes/ActiveRecord/Migration.html
--
Posted via http://www.ruby-forum.com/.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric Yen  
View profile  
 More options Jul 29 2010, 10:42 am
From: Eric Yen <e...@ericyen.com>
Date: Thu, 29 Jul 2010 07:42:37 -0700 (PDT)
Local: Thurs, Jul 29 2010 10:42 am
Subject: Re: Migration: updating a column
Thanks.

I was under the impression that change_column was only for renaming.

On Jul 29, 9:19 am, Ar Chron <li...@ruby-forum.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Colin Law  
View profile  
 More options Jul 29 2010, 3:54 pm
From: Colin Law <clan...@googlemail.com>
Date: Thu, 29 Jul 2010 20:54:55 +0100
Local: Thurs, Jul 29 2010 3:54 pm
Subject: Re: [Rails] Re: Migration: updating a column
On 29 July 2010 15:42, Eric Yen <e...@ericyen.com> wrote:

> Thanks.

> I was under the impression that change_column was only for renaming.

Please don't top post on this list.  Thanks.
rename_column is for renaming, change_column is for changing the
attributes of the col.

Column


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »