From 57369af7a13e5f88f886be50a64318a783518a27 Mon Sep 17 00:00:00 2001 From: Pistos Date: Mon, 12 Dec 2011 22:55:21 -0500 Subject: [PATCH] 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. --- .../20110105051803_create_import_tables.rb | 24 +++++++++---------- db/migrate/20110301202619_drop_statistics.rb | 4 ++-- .../20110406202932_drop_requests_table.rb | 2 +- .../20110604012703_drop_mongo_remains.rb | 2 +- .../20110830170929_remove_pod_stats_table.rb | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/db/migrate/20110105051803_create_import_tables.rb b/db/migrate/20110105051803_create_import_tables.rb index cb936b920..f514f3157 100644 --- a/db/migrate/20110105051803_create_import_tables.rb +++ b/db/migrate/20110105051803_create_import_tables.rb @@ -178,17 +178,17 @@ class CreateImportTables < ActiveRecord::Migration end def self.down - drop_table :mongo_users - drop_table :mongo_services - drop_table :mongo_requests - drop_table :mongo_post_visibilities - drop_table :mongo_invitations - drop_table :mongo_contacts - drop_table :mongo_comments - drop_table :mongo_profiles - drop_table :mongo_people - drop_table :mongo_posts - drop_table :mongo_aspect_memberships - drop_table :mongo_aspects + execute 'DROP TABLE mongo_users' + execute 'DROP TABLE mongo_services' + execute 'DROP TABLE mongo_requests' + execute 'DROP TABLE mongo_post_visibilities' + execute 'DROP TABLE mongo_invitations' + execute 'DROP TABLE mongo_contacts' + execute 'DROP TABLE mongo_comments' + execute 'DROP TABLE mongo_profiles' + execute 'DROP TABLE mongo_people' + execute 'DROP TABLE mongo_posts' + execute 'DROP TABLE mongo_aspect_memberships' + execute 'DROP TABLE mongo_aspects' end end diff --git a/db/migrate/20110301202619_drop_statistics.rb b/db/migrate/20110301202619_drop_statistics.rb index 30688ecee..15ec9e366 100644 --- a/db/migrate/20110301202619_drop_statistics.rb +++ b/db/migrate/20110301202619_drop_statistics.rb @@ -1,7 +1,7 @@ class DropStatistics < ActiveRecord::Migration def self.up - drop_table :statistics - drop_table :data_points + execute 'DROP TABLE statistics' + execute 'DROP TABLE data_points' end def self.down diff --git a/db/migrate/20110406202932_drop_requests_table.rb b/db/migrate/20110406202932_drop_requests_table.rb index 96a9b1d4d..f90b17789 100644 --- a/db/migrate/20110406202932_drop_requests_table.rb +++ b/db/migrate/20110406202932_drop_requests_table.rb @@ -10,7 +10,7 @@ class DropRequestsTable < ActiveRecord::Migration remove_index :requests, [:sender_id, :recipient_id] remove_index :requests, :sender_id - drop_table :requests + execute 'DROP TABLE requests' execute( <