Undo some pg changes

This commit is contained in:
Raphael Sofaer 2011-06-15 18:31:56 -07:00
parent 7c454b7d15
commit 728a547cb2
4 changed files with 11 additions and 10 deletions

View file

@ -1,7 +1,7 @@
source 'http://rubygems.org' source 'http://rubygems.org'
#gem 'mysql2', '0.2.6' gem 'mysql2', '0.2.6'
gem 'pg' #gem 'pg'
gem 'rails', '3.0.3' gem 'rails', '3.0.3'
gem 'foreigner', '0.9.1' gem 'foreigner', '0.9.1'

View file

@ -226,6 +226,7 @@ GEM
multi_json (1.0.3) multi_json (1.0.3)
multi_xml (0.2.2) multi_xml (0.2.2)
multipart-post (1.1.2) multipart-post (1.1.2)
mysql2 (0.2.6)
net-ldap (0.2.2) net-ldap (0.2.2)
net-scp (1.0.4) net-scp (1.0.4)
net-ssh (>= 1.99.1) net-ssh (>= 1.99.1)
@ -282,7 +283,6 @@ GEM
oa-openid (= 0.2.6) oa-openid (= 0.2.6)
open4 (1.0.1) open4 (1.0.1)
orm_adapter (0.0.5) orm_adapter (0.0.5)
pg (0.11.0)
polyglot (0.3.1) polyglot (0.3.1)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (1.2.3) rack (1.2.3)
@ -430,11 +430,11 @@ DEPENDENCIES
linecache (= 0.43) linecache (= 0.43)
mini_magick (= 3.2) mini_magick (= 3.2)
mongrel mongrel
mysql2 (= 0.2.6)
newrelic_rpm newrelic_rpm
nokogiri nokogiri
ohai (= 0.5.8) ohai (= 0.5.8)
omniauth (= 0.2.6) omniauth (= 0.2.6)
pg
rails (= 3.0.3) rails (= 3.0.3)
rcov rcov
resque (= 1.10.0) resque (= 1.10.0)

View file

@ -1,4 +1,5 @@
class PostVisibilitiesOnContacts < ActiveRecord::Migration class PostVisibilitiesOnContacts < ActiveRecord::Migration
class PostVisibility < ActiveRecord::Base; end
def self.move_author_pvs_to_aspect_pvs def self.move_author_pvs_to_aspect_pvs
where_clause = <<SQL where_clause = <<SQL
FROM post_visibilities as pv FROM post_visibilities as pv
@ -57,11 +58,7 @@ SQL
end end
def self.pv_count def self.pv_count
@pv_count ||= lambda { @pv_count ||= PostVisibility.count
count = execute('SELECT count(*) FROM post_visibilities').to_a.first.first
count = count.last.to_i if self.connection.class == ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
count
}.call
end end
def self.up def self.up

View file

@ -81,7 +81,7 @@ ActiveRecord::Schema.define(:version => 20110606192307) do
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "conversation_visibilities", ["conversation_id", "person_id"], :name => "index_conversation_visibilities_on_everything", :unique => true add_index "conversation_visibilities", ["conversation_id", "person_id"], :name => "index_conversation_visibilities_on_conversation_id_and_person_id", :unique => true
add_index "conversation_visibilities", ["conversation_id"], :name => "index_conversation_visibilities_on_conversation_id" add_index "conversation_visibilities", ["conversation_id"], :name => "index_conversation_visibilities_on_conversation_id"
add_index "conversation_visibilities", ["person_id"], :name => "index_conversation_visibilities_on_person_id" add_index "conversation_visibilities", ["person_id"], :name => "index_conversation_visibilities_on_person_id"
@ -93,6 +93,8 @@ ActiveRecord::Schema.define(:version => 20110606192307) do
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "conversations", ["author_id"], :name => "conversations_author_id_fk"
create_table "invitations", :force => true do |t| create_table "invitations", :force => true do |t|
t.text "message" t.text "message"
t.integer "sender_id", :null => false t.integer "sender_id", :null => false
@ -117,6 +119,7 @@ ActiveRecord::Schema.define(:version => 20110606192307) do
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "likes", ["author_id"], :name => "likes_author_id_fk"
add_index "likes", ["guid"], :name => "index_likes_on_guid", :unique => true add_index "likes", ["guid"], :name => "index_likes_on_guid", :unique => true
add_index "likes", ["post_id"], :name => "index_likes_on_post_id" add_index "likes", ["post_id"], :name => "index_likes_on_post_id"
@ -141,6 +144,7 @@ ActiveRecord::Schema.define(:version => 20110606192307) do
end end
add_index "messages", ["author_id"], :name => "index_messages_on_author_id" add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
add_index "messages", ["conversation_id"], :name => "messages_conversation_id_fk"
create_table "notification_actors", :force => true do |t| create_table "notification_actors", :force => true do |t|
t.integer "notification_id" t.integer "notification_id"