diff --git a/db/migrate/20110729045734_add_full_name_to_profile.rb b/db/migrate/20110729045734_add_full_name_to_profile.rb index 6096b3447..aa79ae78f 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 262110e4c..810e73825 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 4e8b31a3c..ffbc16999 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 e0c1cb6e1..8250b4eb7 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 18a89425a..ab19419e0 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 ffeed4566..a6c0e73c0 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 ca8ea4b37..caa42d8c9 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