socialforge/db/migrate/20161220062249_create_conte...

27 lines
667 B
Ruby
Raw Normal View History

2016-12-22 10:01:37 +08:00
class CreateContests < ActiveRecord::Migration
def change
#drop_table :contests
#drop_table :contest_notifications
#drop_table :contesting_projects
#drop_table :contesting_softapplications
#drop_table :contestnotifications
create_table :contests do |t|
t.integer :user_id
t.string :name
t.text :description
t.boolean :is_public
t.boolean :is_delete, :default => false
t.integer :visits, :default => 0
t.string :invite_code
t.integer :invite_code_halt, :default => 0
t.timestamps
end
for i in 1 .. 779
Contest.create(:user_id => 2, :is_public => false)
end
end
end