]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/Data/Result/Job.pm
Use ON DELETE CASCADE and TEXT instead of enums
[gruntmaster-data.git] / lib / Gruntmaster / Data / Result / Job.pm
index 6f1084ffe98408dcde59b8f57133ddea2f90d281..0bb76b9355cf76efb40536311c5fe0d82bf167de 100644 (file)
@@ -34,7 +34,7 @@ __PACKAGE__->table("jobs");
 
   data_type: 'text'
   is_foreign_key: 1
-  is_nullable: 0
+  is_nullable: 1
 
 =head2 daemon
 
@@ -85,7 +85,7 @@ __PACKAGE__->table("jobs");
 
 =head2 results
 
-  data_type: 'json'
+  data_type: 'text'
   is_nullable: 1
 
 =head2 source
@@ -110,7 +110,7 @@ __PACKAGE__->add_columns(
     sequence          => "jobs_id_seq",
   },
   "contest",
-  { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
+  { data_type => "text", is_foreign_key => 1, is_nullable => 1 },
   "daemon",
   { data_type => "text", is_nullable => 1 },
   "date",
@@ -130,7 +130,7 @@ __PACKAGE__->add_columns(
   "result_text",
   { data_type => "text", is_nullable => 1 },
   "results",
-  { data_type => "json", is_nullable => 1 },
+  { data_type => "text", is_nullable => 1 },
   "source",
   { data_type => "text", is_nullable => 0 },
   "owner",
@@ -163,7 +163,12 @@ __PACKAGE__->belongs_to(
   "contest",
   "Gruntmaster::Data::Result::Contest",
   { id => "contest" },
-  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
+  {
+    is_deferrable => 0,
+    join_type     => "LEFT",
+    on_delete     => "CASCADE",
+    on_update     => "NO ACTION",
+  },
 );
 
 =head2 owner
@@ -178,7 +183,7 @@ __PACKAGE__->belongs_to(
   "owner",
   "Gruntmaster::Data::Result::User",
   { id => "owner" },
-  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
 );
 
 =head2 problem
@@ -193,13 +198,38 @@ __PACKAGE__->belongs_to(
   "problem",
   "Gruntmaster::Data::Result::Problem",
   { id => "problem" },
-  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
+  { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-03-06 12:41:16
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lIETgGgMTSOUUuDuFa/+SQ
+# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-05-16 15:03:32
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k3Oq7pNqFoCI5NwY5GaWfQ
 
+sub rerun {
+       shift->update({daemon => undef, result => -2, result_text => undef});
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
+
+__END__
+
+=head1 METHODS
+
+=head2 rerun
+
+Reruns this job.
+
+=head1 AUTHOR
+
+Marius Gavrilescu E<lt>marius@ieval.roE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014 by Marius Gavrilescu
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.18.1 or,
+at your option, any later version of Perl 5 you may have available.
+
+
+=cut
This page took 0.023813 seconds and 4 git commands to generate.