[Bast-commits] r8440 - DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB

frew at dev.catalyst.perl.org frew at dev.catalyst.perl.org
Wed Jan 27 07:08:03 GMT 2010


Author: frew
Date: 2010-01-27 07:08:03 +0000 (Wed, 27 Jan 2010)
New Revision: 8440

Modified:
   DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditHistory.pm
   DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm
   DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeLog.pm
   DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm
Log:
whitespace, use base Core, and an idea on backcompat

Modified: DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditHistory.pm
===================================================================
--- DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditHistory.pm	2010-01-27 07:06:09 UTC (rev 8439)
+++ DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditHistory.pm	2010-01-27 07:08:03 UTC (rev 8440)
@@ -1,14 +1,12 @@
 package DBIx::Class::Schema::Journal::DB::AuditHistory;
 
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
 
 sub journal_define_table {
     my ( $class, $source ) = @_;
 
-    $class->load_components(qw(Core));
+    $class->table($source->name . '_audit_history');
 
-    $class->table($source->name . "_audit_history");
-    
     $class->add_columns(
         audit_history_id => {
             data_type => 'integer',
@@ -23,7 +21,7 @@
         },
     );
 
-    $class->set_primary_key("audit_history_id");
+    $class->set_primary_key('audit_history_id');
 
     foreach my $column ( $source->columns ) {
         my $info = $source->column_info($column);
@@ -36,13 +34,13 @@
             is_auto_increment
             default_value
         );
-        
+
         $hist_info{is_nullable} = 1;
 
         $class->add_column($column => \%hist_info);
     }
-                           
-    $class->belongs_to('change', 'DBIx::Class::Schema::Journal::DB::ChangeLog', 'audit_change_id');
+
+    $class->belongs_to(change => 'DBIx::Class::Schema::Journal::DB::ChangeLog', 'audit_change_id');
 }
 
 1;

Modified: DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm
===================================================================
--- DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm	2010-01-27 07:06:09 UTC (rev 8439)
+++ DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/AuditLog.pm	2010-01-27 07:08:03 UTC (rev 8440)
@@ -1,14 +1,12 @@
 package DBIx::Class::Schema::Journal::DB::AuditLog;
 
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
 
 sub journal_define_table {
     my ( $class, $source ) = @_;
 
-    $class->load_components(qw(Core));
+    $class->table($source->name . '_audit_log');
 
-    $class->table($source->name . "_audit_log");
-
     $class->add_columns(
         create_id => {
             data_type => 'integer',
@@ -28,8 +26,8 @@
 
     $class->set_primary_key( $source->primary_columns );
 
-    $class->belongs_to('created', 'DBIx::Class::Schema::Journal::DB::ChangeLog', 'create_id');
-    $class->belongs_to('deleted', 'DBIx::Class::Schema::Journal::DB::ChangeLog', 'delete_id');
+    $class->belongs_to(created => 'DBIx::Class::Schema::Journal::DB::ChangeLog', 'create_id');
+    $class->belongs_to(deleted => 'DBIx::Class::Schema::Journal::DB::ChangeLog', 'delete_id');
 }
 
 1;

Modified: DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeLog.pm
===================================================================
--- DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeLog.pm	2010-01-27 07:06:09 UTC (rev 8439)
+++ DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeLog.pm	2010-01-27 07:08:03 UTC (rev 8440)
@@ -1,27 +1,27 @@
 package DBIx::Class::Schema::Journal::DB::ChangeLog;
 
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
 
-__PACKAGE__->load_components(qw/Ordered Core/);
+__PACKAGE__->load_components(qw/Ordered/);
 __PACKAGE__->table('changelog');
 
 __PACKAGE__->add_columns(
-                         ID => {
-                             data_type => 'integer',
-                             is_auto_increment => 1,
-                             is_primary_key => 1,
-                             is_nullable => 0,
-                         },
-                         changeset_id => {
-                             data_type => 'integer',
-                             is_nullable => 0,
-                             is_foreign_key => 1,
-                         },
-                         order_in => {
-                             data_type => 'integer',
-                             is_nullable => 0,
-                         },
-                         );
+	ID => {
+		data_type => 'integer',
+		is_auto_increment => 1,
+		is_primary_key => 1,
+		is_nullable => 0,
+	},
+		changeset_id => {
+		data_type => 'integer',
+		is_nullable => 0,
+		is_foreign_key => 1,
+	},
+	order_in => {
+		data_type => 'integer',
+		is_nullable => 0,
+	},
+);
 
 
 __PACKAGE__->set_primary_key('ID');
@@ -30,4 +30,5 @@
 
  __PACKAGE__->position_column('order_in');
  __PACKAGE__->grouping_column('changeset_id');
+
 1;

Modified: DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm
===================================================================
--- DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm	2010-01-27 07:06:09 UTC (rev 8439)
+++ DBIx-Class-Journal/1.000/trunk/lib/DBIx/Class/Schema/Journal/DB/ChangeSet.pm	2010-01-27 07:08:03 UTC (rev 8440)
@@ -1,35 +1,41 @@
 package DBIx::Class::Schema::Journal::DB::ChangeSet;
 
-use base 'DBIx::Class';
+use base 'DBIx::Class::Core';
 
-__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
 __PACKAGE__->table('changeset');
 
 __PACKAGE__->add_columns(
-                         ID => {
-                             data_type => 'integer',
-                             is_auto_increment => 1,
-                             is_primary_key => 1,
-                             is_nullable => 0,
-                         },
-                         user_id => {
-                             data_type => 'integer',
-                             is_nullable => 1,
-                             is_foreign_key => 1,
-                         },
-                         set_date => {
-                             data_type => 'timestamp',
-                             is_nullable => 0,
-                         },
-                         session_id => {
-                             data_type => 'varchar',
-                             size => 255,
-                             is_nullable => 1,
-                         },
-                         );
+	ID => {
+		data_type => 'integer',
+		is_auto_increment => 1,
+		is_primary_key => 1,
+		is_nullable => 0,
+	},
+	user_id => {
+		data_type => 'integer',
+		is_nullable => 1,
+		is_foreign_key => 1,
+	},
+	set_date => {
+		data_type => 'timestamp',
+		is_nullable => 0,
+	},
+	session_id => {
+		data_type => 'varchar',
+		size => 255,
+		is_nullable => 1,
+	},
+);
 
 sub new {
     my $self = shift->next::method(@_);
+	 # I think we should not do the following and
+	 # instead use DBIx::Class::TimeStamp.  If I
+	 # can think of a good way (passing a version on
+	 # import?) to do it and retain backcompat I will.
+	 #
+	 # --fREW, 01-27-2010
     $self->set_date(gmtime);
     return $self;
 }




More information about the Bast-commits mailing list