forgeplus/db/migrate/20230812200835_create_proje...

22 lines
1.0 KiB
Ruby

# encoding: utf-8
class CreateProjectEvaluations < ActiveRecord::Migration[5.2]
def change
create_table :project_evaluations do |t|
t.integer :project_id, foreign_key: true, index: true
t.float :influence, default: 0, comment: "影响力"
t.float :community, default: 0, comment: "社区活跃度"
t.float :vitality, default: 0, comment: "代码活跃度"
t.float :health, default: 0, comment: "团队健康"
t.float :trend, default: 0, comment: "流行趋势"
t.float :norm_influence, default: 0, comment: "归一化影响力"
t.float :norm_community, default: 0, comment: "归一化社区活跃度"
t.float :norm_vitality, default: 0, comment: "归一化代码活跃度"
t.float :norm_health, default: 0, comment: "归一化团队健康"
t.float :norm_trend, default: 0, comment: "归一化流行趋势"
t.float :score, default: 0, comment: "总分"
t.timestamps
end
add_foreign_key :project_evaluations, :projects, column: :project_id
end
end