Sha256: 65134de96ad4834cd44f5def8c0e8233641476c4768c56c8b2ad1454fc299a2f

Contents?: true

Size: 1.94 KB

Versions: 5

Compression:

Stored size: 1.94 KB

Contents

Sequel.migration do

  up do
    add_column(:settings, :language_key      , String) 
    add_column(:settings, :language_group_key, String)

    # Set the correct values for all rows
    Zen::Database.handle[:settings].filter(:key => 'website_name')
      .update(
        :language_key       => 'settings.labels.website_name',
        :language_group_key => 'settings.tabs.general'
      )

    Zen::Database.handle[:settings].filter(:key => 'website_description')
      .update(
        :language_key       => 'settings.labels.website_description',
        :language_group_key => 'settings.tabs.general'
      )

    Zen::Database.handle[:settings].filter(:key => 'website_enabled')
      .update(
        :language_key       => 'settings.labels.website_enabled',
        :language_group_key => 'settings.tabs.general'
      )

    Zen::Database.handle[:settings].filter(:key => 'language')
      .update(
        :language_key       => 'settings.labels.language',
        :language_group_key => 'settings.tabs.general'
      )

    Zen::Database.handle[:settings].filter(:key => 'default_section')
      .update(
        :language_key       => 'settings.labels.default_section',
        :language_group_key => 'settings.tabs.general'
      )

    Zen::Database.handle[:settings].filter(:key => 'theme')
      .update(
        :language_key       => 'settings.labels.theme',
        :language_group_key => 'settings.tabs.general'
      )

    Zen::Database.handle[:settings].filter(:key => 'enable_antispam')
      .update(
        :language_key       => 'settings.labels.enable_antispam',
        :language_group_key => 'settings.tabs.security'
      )

    Zen::Database.handle[:settings].filter(:key => 'defensio_key')
      .update(
        :language_key       => 'settings.labels.defensio_key',
        :language_group_key => 'settings.tabs.security'
      )
  end
  
  down do
    drop_column(:settings, :language_key)
    drop_column(:settings, :language_group_key)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zen-0.2.5 lib/zen/package/settings/migrations/1299538742_add_language_key.rb
zen-0.2.4.1 lib/zen/package/settings/migrations/1299538742_add_language_key.rb
zen-0.2.4 lib/zen/package/settings/migrations/1299538742_add_language_key.rb
zen-0.2.3 lib/zen/package/settings/migrations/1299538742_add_language_key.rb
zen-0.2 lib/zen/package/settings/migrations/1299538742_add_language_key.rb