Hey guys, been a while...

I have a Postgres (current) database that has a bunch of log tables. On top of those is a bunch of views that take the most recent record, basically going like:

CREATE VIEW foo AS SELECT * FROM foo_log a
WHERE NOT EXISTS (SELECT 1 from foo_log b where b.since > a.since);

("Since" is a timestamp and part of the primary key in the log table, but not in the view, of course.)

Anyhow, I'm trying to use Schema::Loader (current) to build out the schema and it (naturally) sees these views as not having primary keys and the columns as nullable (they aren't in the underlying tables) and of course no relationships, though the underlying log tables are related to one another. I don't expect Schema::Loader can see that, I just want to override it.

So what I'm wondering is if there is a way to tell Schema::Loader "these views are just like those tables minus one dimension" or if I'm better off just concocting the classes for those views by hand.

Oh, one other thing. I could have sworn a few years ago that I could abridge the class names in relation specs, just putting Foo instead of My::Schema::Foo in has_many/belongs_to etc. Did that change?

Thanks,

--
Dorian Taylor
http://doriantaylor.com/


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to