mirror of
https://github.com/internetee/registry.git
synced 2025-05-28 16:39:55 +02:00
Refactor settings
This commit is contained in:
parent
26f5eda636
commit
dafcb6f78c
25 changed files with 132 additions and 282 deletions
|
@ -1,9 +0,0 @@
|
|||
class CreateSettings < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :settings do |t|
|
||||
t.integer :setting_group_id
|
||||
t.string :code
|
||||
t.string :value
|
||||
end
|
||||
end
|
||||
end
|
18
db/migrate/20141015135255_create_settings.rb
Normal file
18
db/migrate/20141015135255_create_settings.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
class CreateSettings < ActiveRecord::Migration
|
||||
def self.up
|
||||
drop_table :settings
|
||||
create_table :settings do |t|
|
||||
t.string :var, :null => false
|
||||
t.text :value, :null => true
|
||||
t.integer :thing_id, :null => true
|
||||
t.string :thing_type, :limit => 30, :null => true
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :settings, [ :thing_type, :thing_id, :var ], :unique => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :settings
|
||||
end
|
||||
end
|
17
db/migrate/20141015135742_correct_settings.rb
Normal file
17
db/migrate/20141015135742_correct_settings.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class CorrectSettings < ActiveRecord::Migration
|
||||
def up
|
||||
drop_table :setting_groups
|
||||
|
||||
Setting.ds_algorithm = 2
|
||||
Setting.ds_data_allowed = true
|
||||
Setting.ds_data_with_key_allowed = true
|
||||
Setting.key_data_allowed = true
|
||||
|
||||
Setting.dnskeys_min_count = 0
|
||||
Setting.dnskeys_max_count = 9
|
||||
Setting.ns_min_count = 2
|
||||
Setting.ns_max_count = 11
|
||||
|
||||
Setting.transfer_wait_time = 0
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue