PRIMARY KEY (contest, problem, owner)
);
+CREATE TABLE limits (
+ problem TEXT NOT NULL REFERENCES problems ON DELETE CASCADE,
+ format TEXT NOT NULL,
+ timeout REAL NOT NULL,
+ PRIMARY KEY (problem, format)
+);
+
CREATE TABLE table_comments (
table_name TEXT NOT NULL PRIMARY KEY,
comment_text TEXT NOT NULL
INSERT INTO table_comments VALUES ('jobs', 'List of jobs');
INSERT INTO table_comments VALUES ('problem_status', 'List of (problem, user, result)');
INSERT INTO table_comments VALUES ('opens', 'List of (contest, problem, user, time when user opened problem)');
+INSERT INTO table_comments VALUES ('limits', 'Time limit overrides for certain problem/format pairs');
INSERT INTO column_comments VALUES ('users', 'passphrase', 'RFC2307-encoded passphrase');
INSERT INTO column_comments VALUES ('users', 'name', 'Full name of user');
}
BEGIN {
- for my $rs (qw/contest contest_problem job open problem user problem_status contest_status/) {
+ for my $rs (qw/contest contest_problem job open limit problem user problem_status contest_status/) {
my $rsname = ucfirst $rs;
$rsname =~ s/_([a-z])/\u$1/gs;
dynsub PL_N($rs) => sub { $_[0]->resultset($rsname) };
--- /dev/null
+use utf8;
+package Gruntmaster::Data::Result::Limit;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Gruntmaster::Data::Result::Limit - Time limit overrides for certain problem/format pairs
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<limits>
+
+=cut
+
+__PACKAGE__->table("limits");
+
+=head1 ACCESSORS
+
+=head2 problem
+
+ data_type: 'text'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 format
+
+ data_type: 'text'
+ is_nullable: 0
+
+=head2 timeout
+
+ data_type: 'real'
+ is_nullable: 0
+
+=cut
+
+__PACKAGE__->add_columns(
+ "problem",
+ { data_type => "text", is_foreign_key => 1, is_nullable => 0 },
+ "format",
+ { data_type => "text", is_nullable => 0 },
+ "timeout",
+ { data_type => "real", is_nullable => 0 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</problem>
+
+=item * L</format>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("problem", "format");
+
+=head1 RELATIONS
+
+=head2 problem
+
+Type: belongs_to
+
+Related object: L<Gruntmaster::Data::Result::Problem>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "problem",
+ "Gruntmaster::Data::Result::Problem",
+ { id => "problem" },
+ { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-03-16 17:16:58
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ewngP+tVnk4GZ5K+ygUpLg
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
{ cascade_copy => 0, cascade_delete => 0 },
);
+=head2 limits
+
+Type: has_many
+
+Related object: L<Gruntmaster::Data::Result::Limit>
+
+=cut
+
+__PACKAGE__->has_many(
+ "limits",
+ "Gruntmaster::Data::Result::Limit",
+ { "foreign.problem" => "self.id" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
=head2 opens
Type: has_many
__PACKAGE__->many_to_many("contests", "contest_problems", "contest");
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-02-14 09:42:26
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sc9vhXkFlp0UaLK7w0OUXA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-03-16 17:16:58
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N7cuqDEGSn5rf8V5GovRQQ
use Class::Method::Modifiers qw/after/;