Class: CreateRubyCmsPreferences

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/ruby_cms/templates/db/migrate/20260130000002_create_ruby_cms_preferences.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/ruby_cms/templates/db/migrate/20260130000002_create_ruby_cms_preferences.rb', line 4

def change
  create_table :ruby_cms_preferences, if_not_exists: true do |t|
    t.string :key, null: false
    t.text :value
    t.string :value_type, default: "string", null: false
    t.text :description

    t.timestamps
  end

  add_index :ruby_cms_preferences, :key, unique: true, if_not_exists: true
end