Top "Rails-migrations" questions

Rails migrations are used to track and apply database alterations in a reversible manner.

In a rails migration, how can you remove the limit of a field

Is the following correct? change_column :tablename, :fieldname, :limit => null

ruby-on-rails ruby rails-migrations
What is the best way to drop a table & remove a model in Rails 3?

I have a model & a table which I no longer need in my App, I could leave them there …

ruby-on-rails-3 heroku rails-migrations rails-models
Rails migration does not change schema.rb

I have a rails migration that is not being applied to my schema.rb. The migration should create a table: …

ruby-on-rails ruby-on-rails-4 database-migration rails-migrations
Rails : migration for creating a fixed-length char(12) column

What is the best way to define a fixed-length SQL column (CHAR(12) for instance) through a Rails migration ? Why this …

sql ruby-on-rails rails-migrations
Deleting table from schema - Rails

I want to delete a table in my schema. I created the database when I first started the project and …

ruby-on-rails ruby rails-migrations
Can I pass default value to rails generate migration?

I want to know if I can pass a default value to the rails g migration command. Something like: $ rails …

ruby-on-rails ruby-on-rails-3 rails-migrations
Rails naming convention for join table

This questions stems from: How to link form after creating rails join table I am creating the join table between …

ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1 rails-migrations
What is the difference between t.belongs_to and t.references in rails?

What is the difference between t.references and t.belongs_to? Why are we having those two different words? It …

ruby-on-rails rails-migrations
Add a reference column migration in Rails 5

A user has many uploads. I want to add a column to the uploads table that references the user. What …

rails-activerecord ruby-on-rails-5 rails-migrations
Rails Migrations: tried to change the type of column from string to integer

I created a table in my rails app with rails generate migrations command. Here is that migration file: class CreateListings &…

ruby-on-rails ruby postgresql casting rails-migrations