22 lines
533 B
Ruby
22 lines
533 B
Ruby
class CreateWorks < ActiveRecord::Migration
|
|
def change
|
|
create_table :works do |t|
|
|
t.string :name
|
|
t.references :user
|
|
t.text :description
|
|
t.date :publish_time
|
|
t.date :end_time
|
|
t.integer :work_type
|
|
t.references :contest
|
|
t.boolean :is_delete, :default => false
|
|
t.boolean :score_open, :default => true
|
|
t.boolean :is_open, :default => false
|
|
t.integer :work_status
|
|
|
|
t.timestamps
|
|
end
|
|
add_index :works, :user_id
|
|
add_index :works, :contest_id
|
|
end
|
|
end
|