Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

column "table_rows" does not exist #345

Closed
coorasse opened this issue Mar 11, 2015 · 7 comments
Closed

column "table_rows" does not exist #345

coorasse opened this issue Mar 11, 2015 · 7 comments

Comments

@coorasse
Copy link

Just use database_cleaner with Postgres and DatabaseCleaner.strategy = :deletion.
Version 1.4.1 is affected, version 1.4.0 I don't know. Version 1.3.0 is working fine.

@ryanong
Copy link

ryanong commented Mar 28, 2015

This happens to us also. I think it may have something to do with the way schema_plus interacts with database_cleaner

@coorasse
Copy link
Author

No scherma plus for me.

@casiodk
Copy link

casiodk commented Jun 4, 2015

+1

1 similar comment
@csdaraujo
Copy link

+1

@mcclymont
Copy link

+1 With Postgres. Also have pg, postgres_ext, schema_plus gems. I get the issue on 1.4.1 and 1.4.0. We had upgraded to 1.4.1 as part of a Rails 3 -> 4 upgrade. I downgraded database_cleaner to 1.3.0 and this error went away.

@shosti
Copy link
Contributor

shosti commented Dec 28, 2015

Also getting this. I'm not familiar with the inner workings of database_cleaner, but it looks like the problem is https://github.com/DatabaseCleaner/database_cleaner/blob/master/lib/database_cleaner/active_record/deletion.rb#L57 (introduced by 81ca465). table_rows doesn't exist in the Postgres information_schema AFAIK.

@shosti
Copy link
Contributor

shosti commented Dec 28, 2015

Actually looks like this is to do with SchemaPlus (+ maybe other similar gems). From a rails app using PG:

[3] pry(main)> ActiveRecord::ConnectionAdapters::Mysql2Adapter
=> SchemaPlus::ForeignKeys::ActiveRecord::ConnectionAdapters::Mysql2Adapter

That's triggering the defined? condition. I'd be happy to look into this some more...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants