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

"<foo_table> has no primary key" issued also for views [rt.cpan.org #25944] #44

Open
rabbiveesh opened this issue Nov 20, 2022 · 0 comments

Comments

@rabbiveesh
Copy link
Contributor

Migrated from rt.cpan.org#25944 (status was 'open')

Requestors:

From [email protected] on 2007-03-30 09:34:24
:

I'm loading a schema which contains views.

DBIx::Class::Schema::Loader::Base->_load_classess() unconditionally
whines about the lack of a primary key in tables it found.  For views,
this is pointless, as (at least in Postgres) it's not possible to mark
a column as one.

From [email protected] on 2009-04-12 22:47:21
:

I second this [old] request. 

It's an annoying -feature- ... perhaps a quick fix would be to 1) ignore
pk definition altogether for views, or 2) look for first column of view
to be named id and if so, add it is pk for ResultSource definition.

Does this affect anybody else? Are there any workarounds, suggestions of
a fix? I would gladly write up a patch if any comments received from the
comments above...

From [email protected] on 2012-09-09 16:28:56
:

An update on this ticket:

the warning is now gone.

The proper fix for this is to detect views separately from tables and generate proper 
DBIx::Class::ResultSource::View classes with the view SQL so that they can be 
redeployed.

Until that is done, leaving this ticket open.
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

1 participant