Commit 64320911 authored by Daniel Grippi's avatar Daniel Grippi

Merge pull request #2526 from Pistos/postgresql-drop-table

Fix from-scratch migration on PostgreSQL with a non-root DB user
parents 38308086 57369af7
......@@ -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
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
......
......@@ -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( <<SQL
DELETE contacts.* FROM contacts
......
......@@ -10,7 +10,7 @@ class DropMongoRemains < ActiveRecord::Migration
remove_index :services, :mongo_id
remove_index :users, :mongo_id
drop_table :mongo_notifications
execute 'DROP TABLE mongo_notifications'
end
def self.down
......
class RemovePodStatsTable < ActiveRecord::Migration
def self.up
drop_table :pod_stats
execute 'DROP TABLE pod_stats'
end
def self.down
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment