X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FJournal.pm;h=6ba9cd0de1873ff5e965ba151438bf94ae37e702;hb=86e977a34e6e73d80ccdfc7f69f91b28b363a371;hp=1757e512eb9cb7cb5091f7339f25df8d596caa93;hpb=3ef10e3122735252817f61eaaa45b859caea756e;p=dbsrgits%2FDBIx-Class-Journal.git diff --git a/lib/DBIx/Class/Journal.pm b/lib/DBIx/Class/Journal.pm index 1757e51..6ba9cd0 100644 --- a/lib/DBIx/Class/Journal.pm +++ b/lib/DBIx/Class/Journal.pm @@ -73,7 +73,7 @@ sub journal_log_update { =head1 NAME -DBIx::Class::Journal - auditing for tables managed by DBIx::Class +DBIx::Class::Journal - Auditing for tables managed by DBIx::Class =head1 SYNOPSIS @@ -82,6 +82,12 @@ DBIx::Class::Journal - auditing for tables managed by DBIx::Class __PACKAGE__->load_components(qw/Schema::Journal/); +And then call C<< $schema->journal_schema_deploy >> to create all the tables +necessary for the journal, in your database. + +Optionally set where the journal is stored, and associate a user ID with +each changeset. + __PACKAGE__->journal_connection(['dbi:SQLite:t/var/Audit.db']); __PACKAGE__->journal_user(['My::Schema::User', {'foreign.userid' => 'self.user_id'}]); @@ -170,8 +176,7 @@ journalling schema. =item journal_components @components If you want to add components to your journal -(L for example) this would be the - +(L for example) pass them here. =item journal_sources \@source_names @@ -192,12 +197,17 @@ The user_id column in the L will be linked to your user id with a belongs_to relation, if this is set with the appropriate arguments. +=item journal_schema_deploy + +Will use L to set up the tables for +journalling in your schema. Use this method to set up your journal. + =item journal_deploy_on_connect $bool If set to a true value will cause C to be called on C. -Not reccomended, but present for backwards compatibility. +Not recommended, but present for backwards compatibility. =item changeset_user $user_id @@ -207,6 +217,11 @@ Set the user_id for the following changeset(s). This must be an integer. Set the session_id for the following changeset(s). This must be an integer. +=item deploy + +Overloaded L which will deploy your primary +database schema and following that will deploy the journal schema. + =item txn_do $code_ref, @args Overloaded L, this must be used to start a