forge
caicai8 5 years ago
parent b7affb539e
commit fee43f52a7

@ -1,9 +1,16 @@
# encoding: UTF-8
class AddIssuePriosityToTable < ActiveRecord::Migration[5.2] class AddIssuePriosityToTable < ActiveRecord::Migration[5.2]
def change #本地需要修改,线上不用修改
name = %w(低 正常 高 紧急 立刻) # def change
position = %w(1 2 3 4 5) # create_table :issue_priorities do |t|
name.each_with_index do |n, index| # t.string :name, charset: :utf8
IssuePriority.create!(name:n, position: position[index]) # t.integer :position
end # t.timestamps
end # end
# name = %w(低 正常 高 紧急 立刻)
# position = %w(1 2 3 4 5)
# name.each_with_index do |n, index|
# IssuePriority.create!(name:n.to_s, position: position[index])
# end
# end
end end

Loading…
Cancel
Save