Add table and column comments
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 19 Dec 2014 14:54:28 +0000 (16:54 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 19 Dec 2014 14:54:28 +0000 (16:54 +0200)
db.sql
lib/Gruntmaster/Data/Result/Contest.pm
lib/Gruntmaster/Data/Result/ContestProblem.pm
lib/Gruntmaster/Data/Result/ContestStatus.pm
lib/Gruntmaster/Data/Result/Job.pm
lib/Gruntmaster/Data/Result/Open.pm
lib/Gruntmaster/Data/Result/Problem.pm
lib/Gruntmaster/Data/Result/ProblemStatus.pm
lib/Gruntmaster/Data/Result/User.pm

diff --git a/db.sql b/db.sql
index 696cec175e2f0a3d5d7574dae80cee94cc271897..f5f988b4a329c6aae2ae135ef1a6a298fd89f049 100644 (file)
--- a/db.sql
+++ b/db.sql
@@ -92,3 +92,61 @@ CREATE TABLE opens (
        time    BIGINT NOT NULL,
        PRIMARY KEY (contest, problem, owner)
 );
+
+CREATE TABLE table_comments (
+       table_name   TEXT NOT NULL PRIMARY KEY,
+       comment_text TEXT NOT NULL
+);
+
+CREATE TABLE column_comments (
+       table_name   TEXT NOT NULL,
+       column_name  TEXT NOT NULL,
+       comment_text TEXT NOT NULL,
+       PRIMARY KEY (table_name, column_name)
+);
+
+INSERT INTO table_comments VALUES ('users',   'List of users');
+INSERT INTO table_comments VALUES ('contests',   'List of contests');
+INSERT INTO table_comments VALUES ('contest_status',   'List of (contest, user, result)');
+INSERT INTO table_comments VALUES ('problems',   'List of problems');
+INSERT INTO table_comments VALUES ('contest_problems', 'Many-to-many bridge between contests and problems');
+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 column_comments VALUES ('users', 'passphrase', 'RFC2307-encoded passphrase');
+INSERT INTO column_comments VALUES ('users', 'name', 'Full name of user');
+INSERT INTO column_comments VALUES ('users', 'level', 'Highschool, Undergraduate, Master, Doctorate or Other');
+INSERT INTO column_comments VALUES ('users', 'lastjob', 'Unix time when this user last submitted a job');
+
+INSERT INTO column_comments VALUES ('contests', 'start', 'Unix time when contest starts');
+INSERT INTO column_comments VALUES ('contests', 'stop', 'Unix time when contest ends');
+
+INSERT INTO column_comments VALUES ('problems', 'author', 'Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc');
+INSERT INTO column_comments VALUES ('problems', 'writer', 'Full name(s) of statement writer(s) (DEPRECATED)');
+INSERT INTO column_comments VALUES ('problems', 'generator', 'Generator class, without the leading Gruntmaster::Daemon::Generator::');
+INSERT INTO column_comments VALUES ('problems', 'runner', 'Runner class, without the leading Gruntmaster::Daemon::Runner::');
+INSERT INTO column_comments VALUES ('problems', 'judge', 'Judge class, without the leading Gruntmaster::Daemon::Judge::');
+INSERT INTO column_comments VALUES ('problems', 'level', 'Problem level, one of beginner, easy, medium, hard');
+INSERT INTO column_comments VALUES ('problems', 'olimit', 'Output limit (in bytes)');
+INSERT INTO column_comments VALUES ('problems', 'timeout', 'Time limit (in seconds)');
+INSERT INTO column_comments VALUES ('problems', 'solution', 'Solution (HTML)');
+INSERT INTO column_comments VALUES ('problems', 'statement', 'Statement (HTML)');
+INSERT INTO column_comments VALUES ('problems', 'testcnt', 'Number of tests');
+INSERT INTO column_comments VALUES ('problems', 'tests', 'JSON array of test values for ::Runner::File');
+INSERT INTO column_comments VALUES ('problems', 'value', 'Problem value when used in a contest.');
+INSERT INTO column_comments VALUES ('problems', 'genformat', 'Format (programming language) of the generator if using the Run generator');
+INSERT INTO column_comments VALUES ('problems', 'gensource', 'Source code of generator if using the Run generator');
+INSERT INTO column_comments VALUES ('problems', 'verformat', 'Format (programming language) of the verifier if using the Verifier runner');
+INSERT INTO column_comments VALUES ('problems', 'versource', 'Source code of verifier if using the Verifier runner');
+
+INSERT INTO column_comments VALUES ('jobs', 'daemon', 'hostname:PID of daemon that last executed this job. NULL if never executed');
+INSERT INTO column_comments VALUES ('jobs', 'date', 'Unix time when job was submitted');
+INSERT INTO column_comments VALUES ('jobs', 'errors', 'Compiler errors');
+INSERT INTO column_comments VALUES ('jobs', 'extension', 'File extension of submitted program, without a leading dot');
+INSERT INTO column_comments VALUES ('jobs', 'format', 'Format (programming language) of submitted program');
+INSERT INTO column_comments VALUES ('jobs', 'result', 'Job result (integer constant from Gruntmaster::Daemon::Constants)');
+INSERT INTO column_comments VALUES ('jobs', 'result_text', 'Job result (human-readable text)');
+INSERT INTO column_comments VALUES ('jobs', 'results', 'Per-test results (JSON array of hashes with keys id (test number, counting from 1), result (integer constant from Gruntmaster::Daemon::Constants), result_text (human-readable text), time (execution time in decimal seconds))');
+
+INSERT INTO column_comments VALUES ('problem_status', 'solved', 'True if the result is Accepted, False otherwise');
index 77ac716b8c6de2d9e45c7f380e6e8014611c023a..e7b72259d7b10fc05c3736a7200347f4fd3405ea 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::Contest;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::Contest
+Gruntmaster::Data::Result::Contest - List of contests
 
 =cut
 
@@ -38,11 +38,15 @@ __PACKAGE__->table("contests");
   data_type: 'integer'
   is_nullable: 0
 
+Unix time when contest starts
+
 =head2 stop
 
   data_type: 'integer'
   is_nullable: 0
 
+Unix time when contest ends
+
 =head2 owner
 
   data_type: 'text'
@@ -164,8 +168,8 @@ Composing rels: L</contest_problems> -> problem
 __PACKAGE__->many_to_many("problems", "contest_problems", "problem");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nu+Io9AhYkzYCky5UpCaKQ
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IxxZqQwKisBwDabCNUD55Q
 
 use List::Util qw/sum/;
 
index 5ec1dfe998d870545575085d9878cda6e70d8cad..4ae5e4b51893e531ce9e4bc62ec3dcb387391304 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::ContestProblem;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::ContestProblem
+Gruntmaster::Data::Result::ContestProblem - Many-to-many bridge between contests and problems
 
 =cut
 
@@ -91,8 +91,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-05-16 15:03:32
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fG3PNI7Ar318nxMchtJNuA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dTFBC3ZKB2T9SCiyQxxe2w
 
 sub rawcontest { shift->get_column('contest') }
 sub rawproblem { shift->get_column('problem') }
index 2e52e6553877c1883967772b5a127f3ed7d18638..0815e988be356da7416809f263be78d4ed917ac5 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::ContestStatus;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::ContestStatus
+Gruntmaster::Data::Result::ContestStatus - List of (contest, user, result)
 
 =cut
 
@@ -105,8 +105,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vfOfZeATPRODifpgHO4L0A
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IkY4FNON0SrxrP8oNOXoHg
 
 sub rawowner { shift->get_column('owner') }
 
index 0fcf8c0221035e632447d331065eb0c16e13296a..dfb375e7a0a0e40786a65b4213595b3349c1bf96 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::Job;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::Job
+Gruntmaster::Data::Result::Job - List of jobs
 
 =cut
 
@@ -41,26 +41,36 @@ __PACKAGE__->table("jobs");
   data_type: 'text'
   is_nullable: 1
 
+hostname:PID of daemon that last executed this job. NULL if never executed
+
 =head2 date
 
   data_type: 'bigint'
   is_nullable: 0
 
+Unix time when job was submitted
+
 =head2 errors
 
   data_type: 'text'
   is_nullable: 1
 
+Compiler errors
+
 =head2 extension
 
   data_type: 'text'
   is_nullable: 0
 
+File extension of submitted program, without a leading dot
+
 =head2 format
 
   data_type: 'text'
   is_nullable: 0
 
+Format (programming language) of submitted program
+
 =head2 private
 
   data_type: 'boolean'
@@ -78,16 +88,22 @@ __PACKAGE__->table("jobs");
   data_type: 'integer'
   is_nullable: 1
 
+Job result (integer constant from Gruntmaster::Daemon::Constants)
+
 =head2 result_text
 
   data_type: 'text'
   is_nullable: 1
 
+Job result (human-readable text)
+
 =head2 results
 
   data_type: 'text'
   is_nullable: 1
 
+Per-test results (JSON array of hashes with keys id (test number, counting from 1), result (integer constant from Gruntmaster::Daemon::Constants), result_text (human-readable text), time (execution time in decimal seconds))
+
 =head2 source
 
   data_type: 'text'
@@ -217,8 +233,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D49ekK0vGg/7b8xXZoYTWQ
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hEAVL5heV13+nalSmgr0WA
 
 sub rawcontest { shift->get_column('contest') }
 sub rawowner { shift->get_column('owner') }
index 2d6af7cb48df4fdceeb89594408223871800dc4a..495df192462cf73800040a1cb7209afd595de125 100644 (file)
@@ -8,6 +8,10 @@ package Gruntmaster::Data::Result::Open;
 
 Gruntmaster::Data::Result::Open
 
+=head1 DESCRIPTION
+
+List of (contest, problem, user, time when user opened problem)
+
 =cut
 
 use strict;
@@ -123,8 +127,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-05-16 15:03:32
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VihrUa/CI0cg8k8wpHxQDg
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jAao0vjOW87mO37ZQhm4Cw
 
 sub rawowner { shift->get_column('owner') }
 sub rawproblem { shift->get_column('problem') }
index 6359b99af1740672be8e88f8842f5a42facfee79..34c9d876571618c2c04c7cb170473b5249e184e2 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::Problem;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::Problem
+Gruntmaster::Data::Result::Problem - List of problems
 
 =cut
 
@@ -33,26 +33,36 @@ __PACKAGE__->table("problems");
   data_type: 'text'
   is_nullable: 1
 
+Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc
+
 =head2 writer
 
   data_type: 'text'
   is_nullable: 1
 
+Full name(s) of statement writer(s) (DEPRECATED)
+
 =head2 generator
 
   data_type: 'text'
   is_nullable: 0
 
+Generator class, without the leading Gruntmaster::Daemon::Generator::
+
 =head2 judge
 
   data_type: 'text'
   is_nullable: 0
 
+Judge class, without the leading Gruntmaster::Daemon::Judge::
+
 =head2 level
 
   data_type: 'text'
   is_nullable: 0
 
+Problem level, one of beginner, easy, medium, hard
+
 =head2 name
 
   data_type: 'text'
@@ -63,6 +73,8 @@ __PACKAGE__->table("problems");
   data_type: 'integer'
   is_nullable: 1
 
+Output limit (in bytes)
+
 =head2 owner
 
   data_type: 'text'
@@ -80,56 +92,78 @@ __PACKAGE__->table("problems");
   data_type: 'text'
   is_nullable: 0
 
+Runner class, without the leading Gruntmaster::Daemon::Runner::
+
 =head2 solution
 
   data_type: 'text'
   is_nullable: 1
 
+Solution (HTML)
+
 =head2 statement
 
   data_type: 'text'
   is_nullable: 0
 
+Statement (HTML)
+
 =head2 testcnt
 
   data_type: 'integer'
   is_nullable: 0
 
+Number of tests
+
 =head2 tests
 
   data_type: 'text'
   is_nullable: 1
 
+JSON array of test values for ::Runner::File
+
 =head2 timeout
 
   data_type: 'real'
   is_nullable: 0
 
+Time limit (in seconds)
+
 =head2 value
 
   data_type: 'integer'
   is_nullable: 0
 
+Problem value when used in a contest.
+
 =head2 genformat
 
   data_type: 'text'
   is_nullable: 1
 
+Format (programming language) of the generator if using the Run generator
+
 =head2 gensource
 
   data_type: 'text'
   is_nullable: 1
 
+Source code of generator if using the Run generator
+
 =head2 verformat
 
   data_type: 'text'
   is_nullable: 1
 
+Format (programming language) of the verifier if using the Verifier runner
+
 =head2 versource
 
   data_type: 'text'
   is_nullable: 1
 
+Source code of verifier if using the Verifier runner
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -277,8 +311,8 @@ Composing rels: L</contest_problems> -> contest
 __PACKAGE__->many_to_many("contests", "contest_problems", "contest");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1SnNCeJdFr5lM3mmO6rtqA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QZHyWOWaPmTm/EQ5M22CGA
 
 sub is_private {
        my ($self, $time) = @_;
index 69be02fbdbf039e0f5aa69ff0ec10720cb87e630..d46de2be19cae73c2f9d9862be3e01672b3af8d0 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::ProblemStatus;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::ProblemStatus
+Gruntmaster::Data::Result::ProblemStatus - List of (problem, user, result)
 
 =cut
 
@@ -49,6 +49,8 @@ __PACKAGE__->table("problem_status");
   default_value: false
   is_nullable: 0
 
+True if the result is Accepted, False otherwise
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -130,8 +132,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SUAwYQhgBtoCjtFSOMc4FQ
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:44:22
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1OCTO6sM27DamVhQi3dWKg
 
 sub rawowner { shift->get_column('owner') }
 
index c5547c1f776c3b179e54f292600ce7edf26289ad..0b0ba4b95f3f3a721c8f16cb258308fb6247e874 100644 (file)
@@ -6,7 +6,7 @@ package Gruntmaster::Data::Result::User;
 
 =head1 NAME
 
-Gruntmaster::Data::Result::User
+Gruntmaster::Data::Result::User - List of users
 
 =cut
 
@@ -33,6 +33,8 @@ __PACKAGE__->table("users");
   data_type: 'text'
   is_nullable: 1
 
+RFC2307-encoded passphrase
+
 =head2 admin
 
   data_type: 'boolean'
@@ -44,6 +46,8 @@ __PACKAGE__->table("users");
   data_type: 'text'
   is_nullable: 1
 
+Full name of user
+
 =head2 email
 
   data_type: 'text'
@@ -69,11 +73,15 @@ __PACKAGE__->table("users");
   data_type: 'text'
   is_nullable: 1
 
+Highschool, Undergraduate, Master, Doctorate or Other
+
 =head2 lastjob
 
   data_type: 'bigint'
   is_nullable: 1
 
+Unix time when this user last submitted a job
+
 =cut
 
 __PACKAGE__->add_columns(
@@ -204,8 +212,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JcVHC/n8J+NgJge9LkckYA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LiA2+ZpTTelwZJtFpZRsbw
 
 use Authen::Passphrase;
 use Authen::Passphrase::BlowfishCrypt;
This page took 0.0247 seconds and 4 git commands to generate.