forgeplus/db/migrate/20230814091001_create_proje...

17 lines
845 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class CreateProjectEvaluationTops < ActiveRecord::Migration[5.2]
def change
create_table :project_evaluations_tops do |t|
t.integer :project_id, foreign_key: true, index: true
t.column :time_interval, :integer, comment: "时间间隔0: weekly, 1: monthly, 2: quarterly, 3: yearly"
t.float :previous_score, default: 0, comment: "上次得分"
t.float :current_score, default: 0, comment: "本次得分"
t.integer :evaluation_period, comment: "评选期数"
t.timestamps
end
add_index :project_evaluations_tops, :evaluation_period, name: "index_project_evaluations_tops_on_evaluation_period"
add_index :project_evaluations_tops, :time_interval, name: "index_project_evaluations_tops_on_time_interval"
add_foreign_key :project_evaluations_tops, :projects, column: :project_id
end
end