Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T torque-postgresql
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • 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
  • Carlos
  • torque-postgresql
  • Issues
  • #31
Closed
Open
Issue created Feb 08, 2019 by Mikhail Titov@mltContributor

[request] schema-aware disabling of referential integrity while using fixtures

The problem is that when using fixtures for testing, rails disables referential integrity by using table names only. This requires putting all necessary schema names into a schema_search_path in config/database.yml. This is quite a PITA to remember. It would be nice if it was done automagically.

Rails calls ActiveRecord::ConnectionAdapters::PostgreSQL::ReferentialIntegrity#disable_referential_integrity that uses ActiveRecord::ConnectionAdapters::SchemaStatements#tables which returns table names only without schema name to be quoted in #disable_referential_integrity. I feel like something could be done by returning already enquoted (as in PG format() with %I) name within ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaStatements#data_source_sql or somewhere there.

I'm not sure how doable it is or whether it is better to file a bug somewhere upstream, but I'll leave it here as an idea.

Assignee
Assign to
Time tracking