Skip to content

Schema load fails with views defined and existing tables #7

@liveh2o

Description

@liveh2o

When running db:schema:load, the following error is raised:

rake aborted!
ActiveRecord::StatementInvalid: PG::DependentObjectsStillExist: ERROR:  cannot drop table accounts because other objects depend on it
DETAIL:  view account_type_totals depends on table accounts
view daily_account_transaction_totals depends on table accounts
view monthly_account_transaction_totals depends on table accounts
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
: DROP TABLE "accounts"

This is due to the fact that tables are created with :force => true, which drops the table if it exists. Per the error message, we may be able to modify the drop command to include cascading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions