mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
20 lines
485 B
Ruby
20 lines
485 B
Ruby
class CreateReports < ActiveRecord::Migration
|
|
def change
|
|
create_table :reports do |t|
|
|
t.string :name, null: false
|
|
t.string :description
|
|
t.integer :grouped_by, null: false, default: 0
|
|
|
|
t.integer :project_id, null: false
|
|
t.integer :user_id, null: false
|
|
|
|
t.timestamps null: false
|
|
end
|
|
|
|
add_foreign_key :reports, :projects
|
|
add_index :reports, :project_id
|
|
|
|
add_foreign_key :reports, :users
|
|
add_index :reports, :user_id
|
|
end
|
|
end
|