FAQ
Hello,

I'm developing an intranet application with Catalyst an postgresql. As deleted
(and old) records needed to be accesible I created the following db
structure:

table: company - contains company data
- PK: id
- on delete/update copy old data to company_historic

table: company__historic - contains old (or deleted) company data
- PK: historic_id as row id is no longer unique

view: company__view_all
- Union All select over company and company__historic

view: company__view
- filtered view of company__view_all only containg the newest
(MAX on row modified) records for each id

I have the same structure for another 10 (later more) object types.


What I want to achieve:

I would like to write a DBIx::Class component that automagically creates the
instances for ..__historic, ..__view_all, ..__view.


What would be the best way to realize this?


Thank you for every helpfull wink :-)

Greets,
Mario Minati

Search Discussions

  • Mario Minati at Nov 29, 2007 at 2:32 pm

    On Thursday 29 November 2007 10:07:24 you wrote:
    Hello,

    I'm developing an intranet application with Catalyst an postgresql. As
    deleted (and old) records needed to be accesible I created the following db
    structure:

    table: company - contains company data
    - PK: id
    - on delete/update copy old data to company_historic

    table: company__historic - contains old (or deleted) company data
    - PK: historic_id as row id is no longer unique

    view: company__view_all
    - Union All select over company and company__historic

    view: company__view
    - filtered view of company__view_all only containg the newest
    (MAX on row modified) records for each id

    I have the same structure for another 10 (later more) object types.


    What I want to achieve:

    I would like to write a DBIx::Class component that automagically creates
    the instances for ..__historic, ..__view_all, ..__view.


    What would be the best way to realize this?


    Thank you for every helpfull wink :-)

    Greets,
    Mario Minati
    RTFM!?
    http://search.cpan.org/~ash/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Arbitrary_SQL_through_a_custom_ResultSource

    ;-)
    Mario
  • Jess Robinson at Dec 2, 2007 at 12:19 am

    On Thu, 29 Nov 2007, Mario Minati wrote:

    Hello,

    I'm developing an intranet application with Catalyst an postgresql. As deleted
    (and old) records needed to be accesible I created the following db
    structure:

    table: company - contains company data
    - PK: id
    - on delete/update copy old data to company_historic

    table: company__historic - contains old (or deleted) company data
    - PK: historic_id as row id is no longer unique

    view: company__view_all
    - Union All select over company and company__historic

    view: company__view
    - filtered view of company__view_all only containg the newest
    (MAX on row modified) records for each id

    I have the same structure for another 10 (later more) object types.


    What I want to achieve:

    I would like to write a DBIx::Class component that automagically creates the
    instances for ..__historic, ..__view_all, ..__view.


    What would be the best way to realize this?
    You vould look at DBIx::Class::Journal in svn (
    http://dev.catalystframework.org/repos/bast/trunk/DBIx-Class-Journal ) to
    see how that does it..

    (Darn, must release that code..)

    Jess
  • Mario Minati at Dec 2, 2007 at 12:55 pm

    On Sunday 02 December 2007 01:19:05 Jess Robinson wrote:
    On Thu, 29 Nov 2007, Mario Minati wrote:
    Hello,

    I'm developing an intranet application with Catalyst an postgresql. As
    deleted (and old) records needed to be accesible I created the following
    db structure:

    table: company - contains company data
    - PK: id
    - on delete/update copy old data to company_historic

    table: company__historic - contains old (or deleted) company data
    - PK: historic_id as row id is no longer unique

    view: company__view_all
    - Union All select over company and company__historic

    view: company__view
    - filtered view of company__view_all only containg the newest
    (MAX on row modified) records for each id

    I have the same structure for another 10 (later more) object types.


    What I want to achieve:

    I would like to write a DBIx::Class component that automagically creates
    the instances for ..__historic, ..__view_all, ..__view.


    What would be the best way to realize this?
    You vould look at DBIx::Class::Journal in svn (
    http://dev.catalystframework.org/repos/bast/trunk/DBIx-Class-Journal ) to
    see how that does it..
    Wow,
    didn't know about that.

    Thank you.

    Minor bugfix:
    I think DBIx/Class/Schema/Journal/DB/AuduitLog.pm needs to be removed.

    Greets,
    Mario

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbix-class @
categoriesperl, catalyst
postedNov 29, '07 at 9:07a
activeDec 2, '07 at 12:55p
posts4
users2
websitedbix-class.org
irc#dbix-class

2 users in discussion

Mario Minati: 3 posts Jess Robinson: 1 post

People

Translate

site design / logo © 2021 Grokbase