Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #738
Closed
Open
Issue created Jan 20, 2017 by Nick Charlton@nickcharltonContributor

Deleting Customers and/or Orders from the Demo App throws an exception

https://sentry.io/thoughtbot-6l/administrate/issues/207094470/

PG::ForeignKeyViolation: ERROR:  update or delete on table "customers" violates foreign key constraint "fk_rails_99d97e3ae6" on table "orders"
DETAIL:  Key (id)=(14627) is still referenced from table "orders".

  active_record/connection_adapters/postgresql_adapter.rb:598:in `async_exec'
    log(sql, name, binds) { @connection.async_exec(sql, type_casted_binds) }
  active_record/connection_adapters/postgresql_adapter.rb:598:in `block in exec_no_cache'
    log(sql, name, binds) { @connection.async_exec(sql, type_casted_binds) }
  active_record/connection_adapters/abstract_adapter.rb:589:in `block in log'
    :binds          => binds) { yield }
  active_support/notifications/instrumenter.rb:21:in `instrument'
    yield payload
  active_record/connection_adapters/abstract_adapter.rb:583:in `log'
    @instrumenter.instrument(
...
(110 additional frame(s) were not displayed)

ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  update or delete on table "customers" violates foreign key constraint "fk_rails_99d97e3ae6" on table "orders"
DETAIL:  Key (id)=(14627) is still referenced from table "orders".
: DELETE FROM "customers" WHERE "customers"."id" = $1

ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR:  update or delete on table "customers" violates foreign key constraint "fk_rails_99d97e3ae6" on table "orders"
DETAIL:  Key (id)=(14627) is still referenced from table "orders".
: DELETE FROM "customers" WHERE "customers"."id" = $1
Assignee
Assign to
Time tracking