drop_table (with later versions of Rails?) doesn't work with PostgreSQL with a non-root DB user.

You get problems like:

  ERROR:  permission denied: "RI_ConstraintTrigger_506060" is a system trigger

This change is necessary or else nobody will be able to install Diaspora with PostgreSQL.
This commit is contained in:
Pistos 2011-12-12 22:55:21 -05:00
parent 12d0eee7d9
commit 57369af7a1
5 changed files with 17 additions and 17 deletions

View file

@ -178,17 +178,17 @@ class CreateImportTables < ActiveRecord::Migration
end end
def self.down def self.down
drop_table :mongo_users execute 'DROP TABLE mongo_users'
drop_table :mongo_services execute 'DROP TABLE mongo_services'
drop_table :mongo_requests execute 'DROP TABLE mongo_requests'
drop_table :mongo_post_visibilities execute 'DROP TABLE mongo_post_visibilities'
drop_table :mongo_invitations execute 'DROP TABLE mongo_invitations'
drop_table :mongo_contacts execute 'DROP TABLE mongo_contacts'
drop_table :mongo_comments execute 'DROP TABLE mongo_comments'
drop_table :mongo_profiles execute 'DROP TABLE mongo_profiles'
drop_table :mongo_people execute 'DROP TABLE mongo_people'
drop_table :mongo_posts execute 'DROP TABLE mongo_posts'
drop_table :mongo_aspect_memberships execute 'DROP TABLE mongo_aspect_memberships'
drop_table :mongo_aspects execute 'DROP TABLE mongo_aspects'
end end
end end

View file

@ -1,7 +1,7 @@
class DropStatistics < ActiveRecord::Migration class DropStatistics < ActiveRecord::Migration
def self.up def self.up
drop_table :statistics execute 'DROP TABLE statistics'
drop_table :data_points execute 'DROP TABLE data_points'
end end
def self.down def self.down

View file

@ -10,7 +10,7 @@ class DropRequestsTable < ActiveRecord::Migration
remove_index :requests, [:sender_id, :recipient_id] remove_index :requests, [:sender_id, :recipient_id]
remove_index :requests, :sender_id remove_index :requests, :sender_id
drop_table :requests execute 'DROP TABLE requests'
execute( <<SQL execute( <<SQL
DELETE contacts.* FROM contacts DELETE contacts.* FROM contacts

View file

@ -10,7 +10,7 @@ class DropMongoRemains < ActiveRecord::Migration
remove_index :services, :mongo_id remove_index :services, :mongo_id
remove_index :users, :mongo_id remove_index :users, :mongo_id
drop_table :mongo_notifications execute 'DROP TABLE mongo_notifications'
end end
def self.down def self.down

View file

@ -1,6 +1,6 @@
class RemovePodStatsTable < ActiveRecord::Migration class RemovePodStatsTable < ActiveRecord::Migration
def self.up def self.up
drop_table :pod_stats execute 'DROP TABLE pod_stats'
end end
def self.down def self.down