Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Migration in Ruby on Rails

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 249
    Comment on it

    Migrations comes up with the convenient way to alter your database in a structured and organized pattern.
    it makes use of Ruby DSL so no need to write SQL statements, allowing your schema to reflect changes independently.

    Anatomy of Migration

    class CreateProducts < ActiveRecord::Migration
      def up
        create_table :products do |t|
          t.string :name
          t.text :description
    
          t.timestamps
        end
      end
    
      def down
        drop_table :products
      end
    
    end
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: