2020-08-07 01:14:14 +02:00
|
|
|
class CreateSettings < ActiveRecord::Migration[4.2]
|
2013-06-06 03:40:15 +02:00
|
|
|
def self.up
|
|
|
|
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
|
2021-03-01 15:27:26 +01:00
|
|
|
|
|
|
|
add_index :settings, [:thing_type, :thing_id, :var], unique: true
|
2013-06-06 03:40:15 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :settings
|
|
|
|
end
|
|
|
|
end
|