On Wednesday, July 9, 2014 12:03:14 PM UTC-7, Chris Fincher wrote: > > Thanks for the quick response! Deal.primary_key is nil, but when I force > it to be :id, I get a different error where :merchant_id takes the place of > :deal_id. So I think rather than deals being the root of the problem, it's > just the first part being loaded and the first to break. > > Our Oracle expert has told me that she would indeed expect switching from > dba_tab_cols to user_tab_cols to break everything. dba_tab_cols has all of > the columns in the database, and user_tab_cols only has columns from the > tables that the user owns. This app connects to Oracle as a user that owns > no tables, so user_tab_cols is probably empty. Is there an option to go > back to the old behavior on this? Failing that, do you think it would be > especially dangerous to try to go in and override this? >
OK. The reason behind the change is supposedly that dba_tab_cols requires superuser privileges to access. Not being an Oracle expert, I don't know if that is true or not, though from some googling, it does appear to be an issue at least in some configurations. I don't have an issue with making the table to use configurable, but I'm not sure why it would be causing the primary key issue, unless schema parsing is failing completely. The switch from dba_tab_cols to user_tab_cols only effects default parsing, not primary key parsing (which uses all_constraints and all_cons_columns). What does DB.schema(:table_name) return in your setup? If it doesn't raise an error, I'm not sure what the issue is, so you may have to do some manually troubleshooting (use an SQL logger, log all queries, issue each query manually and post the results). Note that if you want a quick fix until this issue is resolved, you can just call set_primary_key manually for all of your models. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
