# frozen_string_literal: true

# encoding: utf-8
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed:field_control_files (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)

# パッケージ制御ファイルテーブル
table_name = 'app_envs'
query = "TRUNCATE TABLE #{table_name}"
puts query.to_s
ActiveRecord::Base.connection_pool.with_connection do |conn|
  conn.execute query.to_s
end
puts "CREATE DATA #{table_name}"
AppEnv.create(:id => 1, :key => 'FILE_LIFE_PERIOD', :value => '3600', :note => '1時間', :category => 3)
AppEnv.create(:id => 2, :key => 'FILE_LIFE_PERIOD', :value => '43200', :note => '12時間', :category => 3)
AppEnv.create(:id => 3, :key => 'FILE_LIFE_PERIOD', :value => '86400', :note => '1日', :category => 3)
AppEnv.create(:id => 4, :key => 'FILE_LIFE_PERIOD', :value => '259200', :note => '3日', :category => 3)
AppEnv.create(:id => 5, :key => 'FILE_LIFE_PERIOD', :value => '604800', :note => '7日', :category => 3)
AppEnv.create(:id => 6, :key => 'FILE_LIFE_PERIOD_DEF', :value => '3', :category => 3)
AppEnv.create(:id => 7, :key => 'RECEIVERS_LIMIT', :value => '5', :category => 3)
AppEnv.create(:id => 8, :key => 'FILE_SEND_LIMIT', :value => '5', :category => 3)
AppEnv.create(:id => 9, :key => 'FILE_SIZE_LIMIT', :value => '50', :category => 3)
AppEnv.create(:id => 10, :key => 'FILE_TOTAL_SIZE_LIMIT', :value => '100', :category => 3)
AppEnv.create(:id => 11, :key => 'MESSAGE_LIMIT', :value => '400', :category => 3)
AppEnv.create(:id => 12, :key => 'PW_LENGTH_MIN', :value => '4', :category => 3)
AppEnv.create(:id => 13, :key => 'PW_LENGTH_MAX', :value => '8', :category => 3)
AppEnv.create(:id => 14, :key => 'FILE_LIFE_PERIOD', :value => '3600', :note => '1時間', :category => 2)
AppEnv.create(:id => 15, :key => 'FILE_LIFE_PERIOD', :value => '43200', :note => '12時間', :category => 2)
AppEnv.create(:id => 16, :key => 'FILE_LIFE_PERIOD', :value => '86400', :note => '1日', :category => 2)
AppEnv.create(:id => 17, :key => 'FILE_LIFE_PERIOD', :value => '259200', :note => '3日', :category => 2)
AppEnv.create(:id => 18, :key => 'FILE_LIFE_PERIOD', :value => '604800', :note => '7日', :category => 2)
AppEnv.create(:id => 19, :key => 'FILE_LIFE_PERIOD_DEF', :value => '16', :category => 2)
AppEnv.create(:id => 20, :key => 'RECEIVERS_LIMIT', :value => '5', :category => 2)
AppEnv.create(:id => 21, :key => 'FILE_SEND_LIMIT', :value => '5', :category => 2)
AppEnv.create(:id => 22, :key => 'FILE_SIZE_LIMIT', :value => '50', :category => 2)
AppEnv.create(:id => 23, :key => 'FILE_TOTAL_SIZE_LIMIT', :value => '100', :category => 2)
AppEnv.create(:id => 24, :key => 'MESSAGE_LIMIT', :value => '400', :category => 2)
AppEnv.create(:id => 25, :key => 'PW_LENGTH_MIN', :value => '4', :category => 2)
AppEnv.create(:id => 26, :key => 'PW_LENGTH_MAX', :value => '8', :category => 2)
AppEnv.create(:id => 27, :key => 'REQUEST_PERIOD', :value => '604800', :note => '7日', :category => 0)
AppEnv.create(:id => 28, :key => 'FILE_DIR', :value => '/var/deco/files', :category => 0)
AppEnv.create(:id => 29, :key => 'PASSWORD_AUTOMATION', :value => '0', :category => 0)
AppEnv.create(:id => 30, :key => 'ENABLE_SSL', :value => '0', :category => 0)
AppEnv.create(:id => 31, :key => 'VIRUS_CHECK', :value => '1', :category => 0)
AppEnv.create(:id => 32, :key => 'VIRUS_CHECK_NOTICE', :value => '0', :category => 0)
AppEnv.create(:id => 33, :key => 'SHOW_PASSWORD_FORM', :value => '1', :category => 0)
AppEnv.create(:id => 34, :key => 'SHOW_PASSWORD_NOTICE_FORM', :value => '1', :category => 0)
AppEnv.create(:id => 35, :key => 'PASSWORD_NOTICE_DEF', :value => '1', :category => 0)
AppEnv.create(:id => 36, :key => 'SHOW_DOWNLOAD_CHECK_FORM', :value => '1', :category => 0)
AppEnv.create(:id => 37, :key => 'DOWNLOAD_CHECK_DEF', :value => '1', :category => 0)
AppEnv.create(:id => 38, :key => 'SHOW_FILE_LIFE_PERIOD_FORM', :value => '1', :category => 0)
AppEnv.create(:id => 39, :key => 'SHOW_CSV_FILE_IMPORT_FORM', :value => '1', :category => 0)
