socialforge/db/migrate/20161220062249_create_conte...

27 lines
699 B
Ruby
Raw Normal View History

2016-12-22 10:01:37 +08:00
class CreateContests < ActiveRecord::Migration
def change
2016-12-22 11:17:13 +08:00
drop_table :contests
drop_table :contest_notifications
drop_table :contesting_projects
drop_table :contesting_softapplications
drop_table :contestnotifications
2016-12-22 10:01:37 +08:00
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
2016-12-22 15:08:15 +08:00
Contest.create(:user_id => 2, :name => 'test', :is_public => false, :is_delete => true)
2016-12-22 10:01:37 +08:00
end
end
end