mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 09:46:09 +02:00
Refactor settings
This commit is contained in:
parent
26f5eda636
commit
dafcb6f78c
25 changed files with 132 additions and 282 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue