diff --git a/db/migrate/20110729045734_add_full_name_to_profile.rb b/db/migrate/20110729045734_add_full_name_to_profile.rb index 6096b3447f112c888d24847a7d3be66e37108e68..aa79ae78f214776530d1cdf7cfced6dbb638acfa 100644 --- a/db/migrate/20110729045734_add_full_name_to_profile.rb +++ b/db/migrate/20110729045734_add_full_name_to_profile.rb @@ -10,7 +10,7 @@ class AddFullNameToProfile < ActiveRecord::Migration remove_index :profiles, [:last_name, :searchable] if Profile.count > 0 - if postgres? + if AppConfig.postgres? execute("UPDATE profiles SET full_name=LOWER(first_name || ' ' || last_name)") else execute("UPDATE profiles SET full_name=LOWER(CONCAT(first_name, ' ', last_name))") diff --git a/db/migrate/20111011195702_share_anything.rb b/db/migrate/20111011195702_share_anything.rb index 262110e4cb5d5309535a409ea42bae6df646763d..810e7382511755fecc9af874b8b6f11d3c269e25 100644 --- a/db/migrate/20111011195702_share_anything.rb +++ b/db/migrate/20111011195702_share_anything.rb @@ -2,7 +2,7 @@ class ShareAnything < ActiveRecord::Migration def self.up remove_foreign_key :aspect_visibilities, :posts - if postgres? + if AppConfig.postgres? execute "DROP INDEX index_aspect_visibilities_on_post_id_and_aspect_id" execute "DROP INDEX index_aspect_visibilities_on_post_id" execute "ALTER TABLE aspect_visibilities RENAME COLUMN post_id TO shareable_id" @@ -46,7 +46,7 @@ class ShareAnything < ActiveRecord::Migration remove_foreign_key :post_visibilities, :posts rename_table :post_visibilities, :share_visibilities - if postgres? + if AppConfig.postgres? execute "DROP INDEX index_post_visibilities_on_contact_id_and_post_id" execute "DROP INDEX index_post_visibilities_on_post_id_and_hidden_and_contact_id" execute "ALTER TABLE share_visibilities RENAME COLUMN post_id TO shareable_id" diff --git a/db/migrate/20111012215141_move_photos_to_their_own_table.rb b/db/migrate/20111012215141_move_photos_to_their_own_table.rb index 4e8b31a3c9cfb4885f85b575e19046520b24308f..ffbc169991e0d734be352f21e0e013a1833fca26 100644 --- a/db/migrate/20111012215141_move_photos_to_their_own_table.rb +++ b/db/migrate/20111012215141_move_photos_to_their_own_table.rb @@ -19,7 +19,7 @@ class MovePhotosToTheirOwnTable < ActiveRecord::Migration t.integer "comments_count" end - if postgres? + if AppConfig.postgres? execute %{ INSERT INTO photos ( tmp_old_id @@ -82,7 +82,7 @@ SQL def self.down - if postgres? + if AppConfig.postgres? execute %{ INSERT INTO posts ( id, author_id, public, diaspora_handle, guid, pending, type, text, diff --git a/db/migrate/20111019013244_postgresql_photos_id_seq_init.rb b/db/migrate/20111019013244_postgresql_photos_id_seq_init.rb index e0c1cb6e1d1edf47438a00b816d9ebe4c69308a0..8250b4eb76d6771fe8ba5e4cc7170c0e027f6685 100644 --- a/db/migrate/20111019013244_postgresql_photos_id_seq_init.rb +++ b/db/migrate/20111019013244_postgresql_photos_id_seq_init.rb @@ -1,6 +1,6 @@ class PostgresqlPhotosIdSeqInit < ActiveRecord::Migration def self.up - if postgres? + if AppConfig.postgres? execute "SELECT setval('photos_id_seq', COALESCE( ( SELECT MAX(id)+1 FROM photos ), 1 ) )" end end diff --git a/db/migrate/20111023230730_fix_photo_share_visibilities.rb b/db/migrate/20111023230730_fix_photo_share_visibilities.rb index 18a89425a3e71db5b9d4e2011d174a29a93d22f8..ab19419e0c4f7eef680814580589b3f7fe3e5001 100644 --- a/db/migrate/20111023230730_fix_photo_share_visibilities.rb +++ b/db/migrate/20111023230730_fix_photo_share_visibilities.rb @@ -4,7 +4,7 @@ class FixPhotoShareVisibilities < ActiveRecord::Migration def self.up return if ! Photo.first.respond_to?(:tmp_old_id) - if postgres? + if AppConfig.postgres? ['aspect_visibilities', 'share_visibilities'].each do |vis_table| execute "UPDATE #{vis_table} SET shareable_type = 'Post'" diff --git a/db/migrate/20111111025358_counter_cache_on_post_reshares.rb b/db/migrate/20111111025358_counter_cache_on_post_reshares.rb index ffeed45665489b5b8406c7ea7f9e7e5bff750e9e..a6c0e73c0e52022db36d444cdb820579dce1abda 100644 --- a/db/migrate/20111111025358_counter_cache_on_post_reshares.rb +++ b/db/migrate/20111111025358_counter_cache_on_post_reshares.rb @@ -4,7 +4,7 @@ class CounterCacheOnPostReshares < ActiveRecord::Migration def self.up add_column :posts, :reshares_count, :integer, :default => 0 - if postgres? + if AppConfig.postgres? execute %{ UPDATE posts SET reshares_count = ( diff --git a/db/migrate/20120202190701_remove_public_share_visibilities.rb b/db/migrate/20120202190701_remove_public_share_visibilities.rb index ca8ea4b3744cc4cef12564cb935f0eee956122a3..caa42d8c9b00d35857d726cc592efce19e8e8bbf 100644 --- a/db/migrate/20120202190701_remove_public_share_visibilities.rb +++ b/db/migrate/20120202190701_remove_public_share_visibilities.rb @@ -16,14 +16,14 @@ class RemovePublicShareVisibilities < ActiveRecord::Migration index = 0 table_name = type.tableize - if postgres? + if AppConfig.postgres? shareable_size = ActiveRecord::Base.connection.execute("SELECT COUNT(*) FROM #{table_name}").first['count'].to_i else shareable_size = ActiveRecord::Base.connection.execute("SELECT COUNT(*) FROM #{table_name}").first.first end while index < shareable_size + 100 do - if postgres? + if AppConfig.postgres? sql = <<-SQL DELETE FROM share_visibilities AS sv