Difference between revisions of "Rails:Migrations"

From Klenwell Wiki
Jump to navigation Jump to search
(Generate a Migration)
(Official Documentation)
Line 1: Line 1:
 
== Official Documentation ==
 
== Official Documentation ==
 
* https://guides.rubyonrails.org/active_record_migrations.html
 
* https://guides.rubyonrails.org/active_record_migrations.html
 +
 +
== Database Types ==
 +
For list of (postgres) column types, see:
 +
 +
* https://stackoverflow.com/q/17918117/1093087
 +
* https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb (See <tt>NATIVE_DATABASE_TYPES</tt>)
  
 
== Schema Migrations ==
 
== Schema Migrations ==

Revision as of 18:27, 27 October 2019

Official Documentation

Database Types

For list of (postgres) column types, see:

Schema Migrations

Generate a Migration

Generic

# rails g migration <name>
rails g migration CreateCruds

Data Migrations

What if you need to do a data migration or data fix on existing data?