dev_aliyun
cxt 6 years ago
parent be80081623
commit 5551a1ae3b

@ -1,14 +1,14 @@
class CreateShixunServiceConfigs < ActiveRecord::Migration class CreateShixunServiceConfigs < ActiveRecord::Migration
def change def change
# create_table :shixun_service_configs do |t| create_table :shixun_service_configs do |t|
# t.references :shixun t.references :shixun
# t.integer :cpu_limit, :default => 1 t.integer :cpu_limit, :default => 1
# t.integer :memory_limit, :default => 1024 t.integer :memory_limit, :default => 1024
# t.integer :request_limit, :default => 10 t.integer :request_limit, :default => 10
# t.float :lower_cpu_limit, :default => 0.1 t.float :lower_cpu_limit, :default => 0.1
# t.integer :resource_limit, :default => 10000 t.integer :resource_limit, :default => 10000
# t.references :mirror_repository t.references :mirror_repository
# t.timestamps t.timestamps
# end end
end end
end end

@ -1,19 +1,19 @@
class AddLimitForShixuns < ActiveRecord::Migration class AddLimitForShixuns < ActiveRecord::Migration
def up def up
# if !Challenge.first.has_attribute?(:exec_time) if !Challenge.first.has_attribute?(:exec_time)
# add_column :challenges, :exec_time, :integer, :default => 120 add_column :challenges, :exec_time, :integer, :default => 120
# end end
# Shixun.find_each do |shixun| Shixun.find_each do |shixun|
# shixun.challenges.update_all(:exec_time => shixun.exec_time) shixun.challenges.update_all(:exec_time => shixun.exec_time)
# shixun.mirror_repositories.each do |mirror| shixun.mirror_repositories.each do |mirror|
# ShixunServiceConfig.create!(:shixun_id => shixun.id, ShixunServiceConfig.create!(:shixun_id => shixun.id,
# :cpu_limit => mirror.cpu_limit, :cpu_limit => mirror.cpu_limit,
# :memory_limit => mirror.memory_limit, :memory_limit => mirror.memory_limit,
# :request_limit => mirror.memory_limit / 3, :request_limit => mirror.memory_limit / 3,
# :mirror_repository_id => mirror.id) :mirror_repository_id => mirror.id)
# end end
# end end
#
end end

@ -1,13 +1,13 @@
class ModifyRequestLimitForShixunServiceConfig < ActiveRecord::Migration class ModifyRequestLimitForShixunServiceConfig < ActiveRecord::Migration
def up def up
# ShixunServiceConfig.find_each do |config| ShixunServiceConfig.find_each do |config|
# # repertoire_id = 5 代表的是大数据的镜像 # repertoire_id = 5 代表的是大数据的镜像
# if config.mirror_repository.repertoire_id != 5 if config.mirror_repository.repertoire_id != 5
# config.update_column(:request_limit, 10) config.update_column(:request_limit, 10)
# else else
# puts("####---#{config.mirror_repository.name}") puts("####---#{config.mirror_repository.name}")
# end end
# end end
end end
def down def down

@ -1,12 +1,12 @@
class CreateUserAgents < ActiveRecord::Migration class CreateUserAgents < ActiveRecord::Migration
def change def change
# create_table :user_agents do |t| create_table :user_agents do |t|
# t.string :type t.string :type
# t.string :key t.string :key
# t.string :ip t.string :ip
#
# t.timestamps t.timestamps
# end end
# add_index(:user_agents, :ip, :unique => true) add_index(:user_agents, :ip, :unique => true)
end end
end end

@ -1,6 +1,6 @@
class ModifyTypeForUserAgents < ActiveRecord::Migration class ModifyTypeForUserAgents < ActiveRecord::Migration
def up def up
# rename_column :user_agents, :type, :agent_type rename_column :user_agents, :type, :agent_type
end end
def down def down

Loading…
Cancel
Save