Answers for "create migration relational table with"

1

make migration with model

php artisan make:model -m <Model name>
Posted by: Guest on January-15-2021
-1

how database migration work

class ChangeProductsPrice < ActiveRecord::Migration[5.0]
  def change
    reversible do |dir|
      change_table :products do |t|
        dir.up   { t.change :price, :string }
        dir.down { t.change :price, :integer }
      end
    end
  end
end
Posted by: Guest on October-13-2020

Code answers related to "create migration relational table with"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language