Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Cannot Generate a Migration

ruby rails migrations

  • Please log in to reply
4 replies to this topic

#1 ipentchev

ipentchev

    Passenger

  • Members
  • 3 posts

Posted 06 April 2014 - 07:44 AM

Hello,

 

I am trying to add a migration to add a column to a model in rails 4.

When I execute

 

rails g migration AddMbtiTestToProfiles mbti_test:string

 

It tells me the operation succeeded, but no migration has been added

to the db/migrate folder.

 

I am stuck at this point and have no clue how to resolve this.

 

Any help will be greatly appreciated.



#2 Norm

Norm

    Passenger

  • Members
  • 7 posts
  • LocationPrescott, AZ, USA

Posted 19 April 2014 - 05:24 PM

You can just go into the migrate folder and create a new file (copy an old migration) with a reasonable filename and start writing the migration by hand.  It is not all that complex just follow what other migrations look like.



#3 ipentchev

ipentchev

    Passenger

  • Members
  • 3 posts

Posted 22 April 2014 - 11:39 AM

Thank you very much for the reply. I will try that.



#4 Bharat Soni

Bharat Soni

    Dispatcher

  • Members
  • 55 posts
  • LocationAhmedabad

Posted 23 April 2014 - 04:54 AM

These command will solve your problem. And the way to generate migration which Norm suggest you is totally wrong.

$ rails generate migration  AddMbtiTestToProfiles mbti_test:string

These should be work in your application, and if not then there is some thing went wrong with your application.


Fun with Ruby on Rails


#5 ipentchev

ipentchev

    Passenger

  • Members
  • 3 posts

Posted 23 April 2014 - 08:25 AM

Bharat Soni,

 

Thank you for your reply. This command does not work. I also think there is something wrong with my application since when I start a new project I have no problems adding a migration. But what could be wrong with the application?!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users