Created
October 28, 2015 10:48
-
-
Save GuskiS/a59553704682c5f44da1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateCategory < ActiveRecord::Migration | |
def change | |
create_table :categories do |t| | |
t.string :title, null: false | |
t.text :description, null: false | |
t.timestamps null: false | |
end | |
end | |
end | |
class CreateItem < ActiveRecord::Migration | |
def change | |
create_table :items do |t| | |
t.string :title, null: false | |
t.text :description | |
t.integer :price, null: false | |
t.references :category, null: false | |
t.datetime :expire_at, null: false | |
t.boolean :validated, null: false, default: true | |
t.integer :count_1, null: false | |
t.integer :count_2, null: false | |
t.integer :count_3, null: false | |
t.integer :count_4, null: false | |
t.timestamps null: false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment