From 0028ffc17f1516842482536541377f6fd741d747 Mon Sep 17 00:00:00 2001 From: Chad Granum Date: Mon, 3 Jun 2024 19:47:00 -0700 Subject: [PATCH] fixme --- author_tools/regen_schema.pl | 10 +- dist.ini | 2 +- lib/App/Yath/Schema.pm | 46 ++ lib/App/Yath/Schema/MariaDB/ApiKey.pm | 94 +++ lib/App/Yath/Schema/MariaDB/Binary.pm | 97 +++ lib/App/Yath/Schema/MariaDB/Config.pm | 79 +++ lib/App/Yath/Schema/MariaDB/Coverage.pm | 146 ++++ .../Yath/Schema/MariaDB/CoverageManager.pm | 83 +++ lib/App/Yath/Schema/MariaDB/Email.pm | 101 +++ .../Schema/MariaDB/EmailVerificationCode.pm | 82 +++ lib/App/Yath/Schema/MariaDB/Event.pm | 166 +++++ lib/App/Yath/Schema/MariaDB/Host.pm | 83 +++ lib/App/Yath/Schema/MariaDB/Job.pm | 105 +++ lib/App/Yath/Schema/MariaDB/JobTry.pm | 154 +++++ lib/App/Yath/Schema/MariaDB/JobTryField.pm | 94 +++ lib/App/Yath/Schema/MariaDB/LogFile.pm | 86 +++ lib/App/Yath/Schema/MariaDB/Permission.pm | 98 +++ lib/App/Yath/Schema/MariaDB/PrimaryEmail.pm | 89 +++ lib/App/Yath/Schema/MariaDB/Project.pm | 108 +++ lib/App/Yath/Schema/MariaDB/Reporting.pm | 138 ++++ lib/App/Yath/Schema/MariaDB/Resource.pm | 116 ++++ lib/App/Yath/Schema/MariaDB/ResourceType.pm | 83 +++ lib/App/Yath/Schema/MariaDB/Run.pm | 206 ++++++ lib/App/Yath/Schema/MariaDB/RunField.pm | 94 +++ lib/App/Yath/Schema/MariaDB/Session.pm | 85 +++ lib/App/Yath/Schema/MariaDB/SessionHost.pm | 114 ++++ lib/App/Yath/Schema/MariaDB/SourceFile.pm | 83 +++ lib/App/Yath/Schema/MariaDB/SourceSub.pm | 83 +++ lib/App/Yath/Schema/MariaDB/Sweep.pm | 85 +++ lib/App/Yath/Schema/MariaDB/Sync.pm | 89 +++ lib/App/Yath/Schema/MariaDB/TestFile.pm | 95 +++ lib/App/Yath/Schema/MariaDB/User.pm | 138 ++++ lib/App/Yath/Schema/MariaDB/Version.pm | 84 +++ lib/App/Yath/Schema/MySQL/ApiKey.pm | 94 +++ lib/App/Yath/Schema/MySQL/Binary.pm | 97 +++ lib/App/Yath/Schema/MySQL/Config.pm | 79 +++ lib/App/Yath/Schema/MySQL/Coverage.pm | 146 ++++ lib/App/Yath/Schema/MySQL/CoverageManager.pm | 83 +++ lib/App/Yath/Schema/MySQL/Email.pm | 101 +++ .../Schema/MySQL/EmailVerificationCode.pm | 82 +++ lib/App/Yath/Schema/MySQL/Event.pm | 166 +++++ lib/App/Yath/Schema/MySQL/Host.pm | 83 +++ lib/App/Yath/Schema/MySQL/Job.pm | 105 +++ lib/App/Yath/Schema/MySQL/JobTry.pm | 154 +++++ lib/App/Yath/Schema/MySQL/JobTryField.pm | 94 +++ lib/App/Yath/Schema/MySQL/LogFile.pm | 86 +++ lib/App/Yath/Schema/MySQL/Permission.pm | 98 +++ lib/App/Yath/Schema/MySQL/PrimaryEmail.pm | 89 +++ lib/App/Yath/Schema/MySQL/Project.pm | 108 +++ lib/App/Yath/Schema/MySQL/Reporting.pm | 138 ++++ lib/App/Yath/Schema/MySQL/Resource.pm | 116 ++++ lib/App/Yath/Schema/MySQL/ResourceType.pm | 83 +++ lib/App/Yath/Schema/MySQL/Run.pm | 206 ++++++ lib/App/Yath/Schema/MySQL/RunField.pm | 94 +++ lib/App/Yath/Schema/MySQL/Session.pm | 85 +++ lib/App/Yath/Schema/MySQL/SessionHost.pm | 114 ++++ lib/App/Yath/Schema/MySQL/SourceFile.pm | 83 +++ lib/App/Yath/Schema/MySQL/SourceSub.pm | 83 +++ lib/App/Yath/Schema/MySQL/Sweep.pm | 85 +++ lib/App/Yath/Schema/MySQL/Sync.pm | 89 +++ lib/App/Yath/Schema/MySQL/TestFile.pm | 95 +++ lib/App/Yath/Schema/MySQL/User.pm | 138 ++++ lib/App/Yath/Schema/MySQL/Version.pm | 84 +++ lib/App/Yath/Schema/Overlay/Event.pm | 23 +- lib/App/Yath/Schema/Overlay/Job.pm | 71 +- lib/App/Yath/Schema/Overlay/JobTry.pm | 51 ++ lib/App/Yath/Schema/Percona/ApiKey.pm | 94 +++ lib/App/Yath/Schema/Percona/Binary.pm | 98 +++ lib/App/Yath/Schema/Percona/Config.pm | 79 +++ lib/App/Yath/Schema/Percona/Coverage.pm | 147 ++++ .../Yath/Schema/Percona/CoverageManager.pm | 83 +++ lib/App/Yath/Schema/Percona/Email.pm | 101 +++ .../Schema/Percona/EmailVerificationCode.pm | 82 +++ lib/App/Yath/Schema/Percona/Event.pm | 169 +++++ lib/App/Yath/Schema/Percona/Host.pm | 83 +++ lib/App/Yath/Schema/Percona/Job.pm | 106 +++ lib/App/Yath/Schema/Percona/JobTry.pm | 154 +++++ lib/App/Yath/Schema/Percona/JobTryField.pm | 95 +++ lib/App/Yath/Schema/Percona/LogFile.pm | 86 +++ lib/App/Yath/Schema/Percona/Permission.pm | 98 +++ lib/App/Yath/Schema/Percona/PrimaryEmail.pm | 89 +++ lib/App/Yath/Schema/Percona/Project.pm | 108 +++ lib/App/Yath/Schema/Percona/Reporting.pm | 138 ++++ lib/App/Yath/Schema/Percona/Resource.pm | 117 ++++ lib/App/Yath/Schema/Percona/ResourceType.pm | 83 +++ lib/App/Yath/Schema/Percona/Run.pm | 207 ++++++ lib/App/Yath/Schema/Percona/RunField.pm | 95 +++ lib/App/Yath/Schema/Percona/Session.pm | 86 +++ lib/App/Yath/Schema/Percona/SessionHost.pm | 114 ++++ lib/App/Yath/Schema/Percona/SourceFile.pm | 83 +++ lib/App/Yath/Schema/Percona/SourceSub.pm | 83 +++ lib/App/Yath/Schema/Percona/Sweep.pm | 85 +++ lib/App/Yath/Schema/Percona/Sync.pm | 89 +++ lib/App/Yath/Schema/Percona/TestFile.pm | 95 +++ lib/App/Yath/Schema/Percona/User.pm | 138 ++++ lib/App/Yath/Schema/Percona/Version.pm | 84 +++ lib/App/Yath/Schema/PostgreSQL/ApiKey.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Binary.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Config.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Coverage.pm | 2 +- .../Yath/Schema/PostgreSQL/CoverageManager.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Email.pm | 2 +- .../PostgreSQL/EmailVerificationCode.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Event.pm | 4 +- lib/App/Yath/Schema/PostgreSQL/Host.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Job.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/JobTry.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/JobTryField.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/LogFile.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Permission.pm | 2 +- .../Yath/Schema/PostgreSQL/PrimaryEmail.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Project.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Reporting.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Resource.pm | 11 +- .../Yath/Schema/PostgreSQL/ResourceType.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Run.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/RunField.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Session.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/SessionHost.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/SourceFile.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/SourceSub.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Sweep.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Sync.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/TestFile.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/User.pm | 2 +- lib/App/Yath/Schema/PostgreSQL/Version.pm | 2 +- lib/App/Yath/Schema/ResultSet.pm | 5 +- lib/App/Yath/Schema/RunProcessor.pm | 108 ++- lib/App/Yath/Schema/SQLite/ApiKey.pm | 89 +++ lib/App/Yath/Schema/SQLite/Binary.pm | 102 +++ lib/App/Yath/Schema/SQLite/Config.pm | 79 +++ lib/App/Yath/Schema/SQLite/Coverage.pm | 156 +++++ lib/App/Yath/Schema/SQLite/CoverageManager.pm | 83 +++ lib/App/Yath/Schema/SQLite/Email.pm | 101 +++ .../Schema/SQLite/EmailVerificationCode.pm | 82 +++ lib/App/Yath/Schema/SQLite/Event.pm | 175 +++++ lib/App/Yath/Schema/SQLite/Host.pm | 83 +++ lib/App/Yath/Schema/SQLite/Job.pm | 105 +++ lib/App/Yath/Schema/SQLite/JobTry.pm | 143 ++++ lib/App/Yath/Schema/SQLite/JobTryField.pm | 94 +++ lib/App/Yath/Schema/SQLite/LogFile.pm | 86 +++ lib/App/Yath/Schema/SQLite/Permission.pm | 93 +++ lib/App/Yath/Schema/SQLite/PrimaryEmail.pm | 89 +++ lib/App/Yath/Schema/SQLite/Project.pm | 113 ++++ lib/App/Yath/Schema/SQLite/Reporting.pm | 153 +++++ lib/App/Yath/Schema/SQLite/Resource.pm | 112 ++++ lib/App/Yath/Schema/SQLite/ResourceType.pm | 83 +++ lib/App/Yath/Schema/SQLite/Run.pm | 204 ++++++ lib/App/Yath/Schema/SQLite/RunField.pm | 94 +++ lib/App/Yath/Schema/SQLite/Session.pm | 85 +++ lib/App/Yath/Schema/SQLite/SessionHost.pm | 107 +++ lib/App/Yath/Schema/SQLite/SourceFile.pm | 83 +++ lib/App/Yath/Schema/SQLite/SourceSub.pm | 83 +++ lib/App/Yath/Schema/SQLite/Sweep.pm | 85 +++ lib/App/Yath/Schema/SQLite/Sync.pm | 89 +++ lib/App/Yath/Schema/SQLite/TestFile.pm | 95 +++ lib/App/Yath/Schema/SQLite/User.pm | 143 ++++ lib/App/Yath/Schema/SQLite/Version.pm | 79 +++ lib/App/Yath/Schema/Util.pm | 57 +- lib/App/Yath/Server/Controller/Events.pm | 25 +- lib/App/Yath/Server/Controller/Files.pm | 28 +- lib/App/Yath/Server/Controller/Stream.pm | 68 +- lib/App/Yath/Server/Controller/View.pm | 4 +- lib/App/Yath/Server/Request.pm | 4 +- share/js/eventtable.js | 3 +- share/js/jobtable.js | 9 +- share/js/runtable.js | 6 +- share/js/view.js | 2 +- share/schema/MariaDB.sql | 614 ++++++++--------- share/schema/MySQL.sql | 610 ++++++++--------- share/schema/Percona.sql | 630 +++++++++--------- share/schema/PostgreSQL.sql | 14 +- share/schema/SQLite.sql | 567 +++++++--------- 173 files changed, 14194 insertions(+), 1487 deletions(-) create mode 100644 lib/App/Yath/Schema/MariaDB/ApiKey.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Binary.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Config.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Coverage.pm create mode 100644 lib/App/Yath/Schema/MariaDB/CoverageManager.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Email.pm create mode 100644 lib/App/Yath/Schema/MariaDB/EmailVerificationCode.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Event.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Host.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Job.pm create mode 100644 lib/App/Yath/Schema/MariaDB/JobTry.pm create mode 100644 lib/App/Yath/Schema/MariaDB/JobTryField.pm create mode 100644 lib/App/Yath/Schema/MariaDB/LogFile.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Permission.pm create mode 100644 lib/App/Yath/Schema/MariaDB/PrimaryEmail.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Project.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Reporting.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Resource.pm create mode 100644 lib/App/Yath/Schema/MariaDB/ResourceType.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Run.pm create mode 100644 lib/App/Yath/Schema/MariaDB/RunField.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Session.pm create mode 100644 lib/App/Yath/Schema/MariaDB/SessionHost.pm create mode 100644 lib/App/Yath/Schema/MariaDB/SourceFile.pm create mode 100644 lib/App/Yath/Schema/MariaDB/SourceSub.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Sweep.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Sync.pm create mode 100644 lib/App/Yath/Schema/MariaDB/TestFile.pm create mode 100644 lib/App/Yath/Schema/MariaDB/User.pm create mode 100644 lib/App/Yath/Schema/MariaDB/Version.pm create mode 100644 lib/App/Yath/Schema/MySQL/ApiKey.pm create mode 100644 lib/App/Yath/Schema/MySQL/Binary.pm create mode 100644 lib/App/Yath/Schema/MySQL/Config.pm create mode 100644 lib/App/Yath/Schema/MySQL/Coverage.pm create mode 100644 lib/App/Yath/Schema/MySQL/CoverageManager.pm create mode 100644 lib/App/Yath/Schema/MySQL/Email.pm create mode 100644 lib/App/Yath/Schema/MySQL/EmailVerificationCode.pm create mode 100644 lib/App/Yath/Schema/MySQL/Event.pm create mode 100644 lib/App/Yath/Schema/MySQL/Host.pm create mode 100644 lib/App/Yath/Schema/MySQL/Job.pm create mode 100644 lib/App/Yath/Schema/MySQL/JobTry.pm create mode 100644 lib/App/Yath/Schema/MySQL/JobTryField.pm create mode 100644 lib/App/Yath/Schema/MySQL/LogFile.pm create mode 100644 lib/App/Yath/Schema/MySQL/Permission.pm create mode 100644 lib/App/Yath/Schema/MySQL/PrimaryEmail.pm create mode 100644 lib/App/Yath/Schema/MySQL/Project.pm create mode 100644 lib/App/Yath/Schema/MySQL/Reporting.pm create mode 100644 lib/App/Yath/Schema/MySQL/Resource.pm create mode 100644 lib/App/Yath/Schema/MySQL/ResourceType.pm create mode 100644 lib/App/Yath/Schema/MySQL/Run.pm create mode 100644 lib/App/Yath/Schema/MySQL/RunField.pm create mode 100644 lib/App/Yath/Schema/MySQL/Session.pm create mode 100644 lib/App/Yath/Schema/MySQL/SessionHost.pm create mode 100644 lib/App/Yath/Schema/MySQL/SourceFile.pm create mode 100644 lib/App/Yath/Schema/MySQL/SourceSub.pm create mode 100644 lib/App/Yath/Schema/MySQL/Sweep.pm create mode 100644 lib/App/Yath/Schema/MySQL/Sync.pm create mode 100644 lib/App/Yath/Schema/MySQL/TestFile.pm create mode 100644 lib/App/Yath/Schema/MySQL/User.pm create mode 100644 lib/App/Yath/Schema/MySQL/Version.pm create mode 100644 lib/App/Yath/Schema/Percona/ApiKey.pm create mode 100644 lib/App/Yath/Schema/Percona/Binary.pm create mode 100644 lib/App/Yath/Schema/Percona/Config.pm create mode 100644 lib/App/Yath/Schema/Percona/Coverage.pm create mode 100644 lib/App/Yath/Schema/Percona/CoverageManager.pm create mode 100644 lib/App/Yath/Schema/Percona/Email.pm create mode 100644 lib/App/Yath/Schema/Percona/EmailVerificationCode.pm create mode 100644 lib/App/Yath/Schema/Percona/Event.pm create mode 100644 lib/App/Yath/Schema/Percona/Host.pm create mode 100644 lib/App/Yath/Schema/Percona/Job.pm create mode 100644 lib/App/Yath/Schema/Percona/JobTry.pm create mode 100644 lib/App/Yath/Schema/Percona/JobTryField.pm create mode 100644 lib/App/Yath/Schema/Percona/LogFile.pm create mode 100644 lib/App/Yath/Schema/Percona/Permission.pm create mode 100644 lib/App/Yath/Schema/Percona/PrimaryEmail.pm create mode 100644 lib/App/Yath/Schema/Percona/Project.pm create mode 100644 lib/App/Yath/Schema/Percona/Reporting.pm create mode 100644 lib/App/Yath/Schema/Percona/Resource.pm create mode 100644 lib/App/Yath/Schema/Percona/ResourceType.pm create mode 100644 lib/App/Yath/Schema/Percona/Run.pm create mode 100644 lib/App/Yath/Schema/Percona/RunField.pm create mode 100644 lib/App/Yath/Schema/Percona/Session.pm create mode 100644 lib/App/Yath/Schema/Percona/SessionHost.pm create mode 100644 lib/App/Yath/Schema/Percona/SourceFile.pm create mode 100644 lib/App/Yath/Schema/Percona/SourceSub.pm create mode 100644 lib/App/Yath/Schema/Percona/Sweep.pm create mode 100644 lib/App/Yath/Schema/Percona/Sync.pm create mode 100644 lib/App/Yath/Schema/Percona/TestFile.pm create mode 100644 lib/App/Yath/Schema/Percona/User.pm create mode 100644 lib/App/Yath/Schema/Percona/Version.pm create mode 100644 lib/App/Yath/Schema/SQLite/ApiKey.pm create mode 100644 lib/App/Yath/Schema/SQLite/Binary.pm create mode 100644 lib/App/Yath/Schema/SQLite/Config.pm create mode 100644 lib/App/Yath/Schema/SQLite/Coverage.pm create mode 100644 lib/App/Yath/Schema/SQLite/CoverageManager.pm create mode 100644 lib/App/Yath/Schema/SQLite/Email.pm create mode 100644 lib/App/Yath/Schema/SQLite/EmailVerificationCode.pm create mode 100644 lib/App/Yath/Schema/SQLite/Event.pm create mode 100644 lib/App/Yath/Schema/SQLite/Host.pm create mode 100644 lib/App/Yath/Schema/SQLite/Job.pm create mode 100644 lib/App/Yath/Schema/SQLite/JobTry.pm create mode 100644 lib/App/Yath/Schema/SQLite/JobTryField.pm create mode 100644 lib/App/Yath/Schema/SQLite/LogFile.pm create mode 100644 lib/App/Yath/Schema/SQLite/Permission.pm create mode 100644 lib/App/Yath/Schema/SQLite/PrimaryEmail.pm create mode 100644 lib/App/Yath/Schema/SQLite/Project.pm create mode 100644 lib/App/Yath/Schema/SQLite/Reporting.pm create mode 100644 lib/App/Yath/Schema/SQLite/Resource.pm create mode 100644 lib/App/Yath/Schema/SQLite/ResourceType.pm create mode 100644 lib/App/Yath/Schema/SQLite/Run.pm create mode 100644 lib/App/Yath/Schema/SQLite/RunField.pm create mode 100644 lib/App/Yath/Schema/SQLite/Session.pm create mode 100644 lib/App/Yath/Schema/SQLite/SessionHost.pm create mode 100644 lib/App/Yath/Schema/SQLite/SourceFile.pm create mode 100644 lib/App/Yath/Schema/SQLite/SourceSub.pm create mode 100644 lib/App/Yath/Schema/SQLite/Sweep.pm create mode 100644 lib/App/Yath/Schema/SQLite/Sync.pm create mode 100644 lib/App/Yath/Schema/SQLite/TestFile.pm create mode 100644 lib/App/Yath/Schema/SQLite/User.pm create mode 100644 lib/App/Yath/Schema/SQLite/Version.pm diff --git a/author_tools/regen_schema.pl b/author_tools/regen_schema.pl index 10cc76dc3..6c990e27a 100644 --- a/author_tools/regen_schema.pl +++ b/author_tools/regen_schema.pl @@ -475,7 +475,7 @@ sub process_uuid { my @uuids; for my $col (keys %cols) { my $data = $cols{$col} or next; - next unless $col eq 'owner' || $col =~ m/_(id|key)$/; + next unless $col =~ m/_uuid$/; next unless $data->{data_type} eq 'binary'; next unless $data->{size} == 16; push @uuids => $col; @@ -485,12 +485,8 @@ sub process_uuid { print $fh @lines; if (@uuids) { - my $specs = join "\n" => map { "__PACKAGE__->inflate_column('$_' => { inflate => \\&uuid_inflate, deflate => \\&uuid_deflate });" } @uuids; - - print $fh <<" EOT"; -use App::Yath::Schema::UUID qw/uuid_inflate uuid_deflate/; -$specs - EOT + my $specs = join "\n" => map { "__PACKAGE__->inflate_column('$_' => { inflate => \\&App::Yath::Schema::Util::format_uuid_for_app, deflate => \\&App::Yath::Schema::Util::format_uuid_for_db });" } @uuids; + print $fh "$specs\n"; } print $fh "# DO NOT MODIFY ANY PART OF THIS FILE\n"; diff --git a/dist.ini b/dist.ini index 0cd72373e..4952ee375 100644 --- a/dist.ini +++ b/dist.ini @@ -130,7 +130,7 @@ Test2::Event = 1.302198 Test2::Event::V2 = 1.302198 Test2::Formatter = 1.302198 Test2::Plugin::MemUsage = 0.002003 -Test2::Plugin::UUID = 0.002003 +Test2::Plugin::UUID = 0.002008 Test2::Tools::AsyncSubtest = 0.000159 Test2::Tools::Basic = 0 Test2::Tools::Compare = 0 diff --git a/lib/App/Yath/Schema.pm b/lib/App/Yath/Schema.pm index 5726486b6..15ef644e5 100644 --- a/lib/App/Yath/Schema.pm +++ b/lib/App/Yath/Schema.pm @@ -3,11 +3,14 @@ use utf8; use strict; use warnings; use Carp qw/confess/; +use Carp::Always; our $VERSION = '2.000000'; use base 'DBIx::Class::Schema'; +use Test2::Util::UUID qw/uuid2bin bin2uuid/; + confess "You must first load a App::Yath::Schema::NAME module" unless $App::Yath::Schema::LOADED; @@ -20,6 +23,49 @@ __PACKAGE__->load_namespaces( default_resultset_class => 'ResultSet', ); +sub is_mysql { + return 1 if is_mariadb(); + return 1 if is_percona(); + return 1 if $App::Yath::Schema::LOADED =~ m/MySQL/; + return 0; +} + +sub is_postgresql { + return 1 if $App::Yath::Schema::LOADED =~ m/PostgreSQL/; + return 0; +} + +sub is_sqlite { + return 1 if $App::Yath::Schema::LOADED =~ m/SQLite/; + return 0; +} + +sub is_percona { + return 1 if $App::Yath::Schema::LOADED =~ m/Percona/; + return 0; +} + +sub is_mariadb { + return 1 if $App::Yath::Schema::LOADED =~ m/MariaDB/; + return 0; +} + +sub format_uuid_for_db { + my $class = shift; + my ($uuid) = @_; + + return $uuid unless is_percona(); + return uuid2bin($uuid); +} + +sub format_uuid_for_app { + my $class = shift; + my ($uuid_bin) = @_; + + return $uuid_bin unless is_percona(); + return bin2uuid($uuid_bin); +} + sub config { my $self = shift; my ($setting, @val) = @_; diff --git a/lib/App/Yath/Schema/MariaDB/ApiKey.pm b/lib/App/Yath/Schema/MariaDB/ApiKey.pm new file mode 100644 index 000000000..c3bffa7d8 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/ApiKey.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::MariaDB::ApiKey; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ApiKey; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("api_keys"); +__PACKAGE__->add_columns( + "value", + { data_type => "uuid", is_nullable => 0 }, + "api_key_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "status", + { + data_type => "enum", + default_value => "active", + extra => { list => ["active", "disabled", "revoked"] }, + is_nullable => 0, + }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("api_key_id"); +__PACKAGE__->add_unique_constraint("value", ["value"]); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::ApiKey - Autogenerated result class for ApiKey in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Binary.pm b/lib/App/Yath/Schema/MariaDB/Binary.pm new file mode 100644 index 000000000..11c557a3d --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Binary.pm @@ -0,0 +1,97 @@ +use utf8; +package App::Yath::Schema::MariaDB::Binary; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Binary; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("binaries"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "binary_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "event_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "is_image", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, + "description", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("binary_id"); +__PACKAGE__->belongs_to( + "event", + "App::Yath::Schema::Result::Event", + { event_id => "event_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Binary - Autogenerated result class for Binary in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Config.pm b/lib/App/Yath/Schema/MariaDB/Config.pm new file mode 100644 index 000000000..db7f159f8 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Config.pm @@ -0,0 +1,79 @@ +use utf8; +package App::Yath::Schema::MariaDB::Config; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Config; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("config"); +__PACKAGE__->add_columns( + "config_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "setting", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "value", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("config_id"); +__PACKAGE__->add_unique_constraint("setting", ["setting"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Config - Autogenerated result class for Config in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Coverage.pm b/lib/App/Yath/Schema/MariaDB/Coverage.pm new file mode 100644 index 000000000..4df03baaa --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Coverage.pm @@ -0,0 +1,146 @@ +use utf8; +package App::Yath::Schema::MariaDB::Coverage; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Coverage; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "coverage_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "coverage_manager_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "source_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "source_sub_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "metadata", + { data_type => "longtext", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("coverage_id"); +__PACKAGE__->add_unique_constraint( + "run_id", + [ + "run_id", + "job_try_id", + "test_file_id", + "source_file_id", + "source_sub_id", + ], +); +__PACKAGE__->belongs_to( + "coverage_manager", + "App::Yath::Schema::Result::CoverageManager", + { coverage_manager_id => "coverage_manager_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "source_file", + "App::Yath::Schema::Result::SourceFile", + { source_file_id => "source_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "source_sub", + "App::Yath::Schema::Result::SourceSub", + { source_sub_id => "source_sub_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Coverage - Autogenerated result class for Coverage in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/CoverageManager.pm b/lib/App/Yath/Schema/MariaDB/CoverageManager.pm new file mode 100644 index 000000000..147c41ebb --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/CoverageManager.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MariaDB::CoverageManager; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::CoverageManager; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage_manager"); +__PACKAGE__->add_columns( + "coverage_manager_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "package", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("coverage_manager_id"); +__PACKAGE__->add_unique_constraint("package", ["package"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.coverage_manager_id" => "self.coverage_manager_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::CoverageManager - Autogenerated result class for CoverageManager in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Email.pm b/lib/App/Yath/Schema/MariaDB/Email.pm new file mode 100644 index 000000000..40399dc40 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Email.pm @@ -0,0 +1,101 @@ +use utf8; +package App::Yath::Schema::MariaDB::Email; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Email; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email"); +__PACKAGE__->add_columns( + "email_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "verified", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "local", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "domain", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->add_unique_constraint("local", ["local", "domain"]); +__PACKAGE__->might_have( + "email_verification_code", + "App::Yath::Schema::Result::EmailVerificationCode", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Email - Autogenerated result class for Email in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/EmailVerificationCode.pm b/lib/App/Yath/Schema/MariaDB/EmailVerificationCode.pm new file mode 100644 index 000000000..c065c5d38 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/EmailVerificationCode.pm @@ -0,0 +1,82 @@ +use utf8; +package App::Yath::Schema::MariaDB::EmailVerificationCode; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::EmailVerificationCode; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email_verification_codes"); +__PACKAGE__->add_columns( + "evcode", + { data_type => "uuid", is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::EmailVerificationCode - Autogenerated result class for EmailVerificationCode in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Event.pm b/lib/App/Yath/Schema/MariaDB/Event.pm new file mode 100644 index 000000000..62cdac619 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Event.pm @@ -0,0 +1,166 @@ +use utf8; +package App::Yath::Schema::MariaDB::Event; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Event; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("events"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "trace_uuid", + { data_type => "uuid", is_nullable => 1 }, + "parent_uuid", + { data_type => "uuid", is_foreign_key => 1, is_nullable => 1 }, + "event_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "parent_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "event_idx", + { data_type => "integer", is_nullable => 0 }, + "event_sdx", + { data_type => "integer", is_nullable => 0 }, + "stamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "nested", + { data_type => "smallint", is_nullable => 0 }, + "is_subtest", + { data_type => "tinyint", is_nullable => 0 }, + "is_diag", + { data_type => "tinyint", is_nullable => 0 }, + "is_harness", + { data_type => "tinyint", is_nullable => 0 }, + "is_time", + { data_type => "tinyint", is_nullable => 0 }, + "causes_fail", + { data_type => "tinyint", is_nullable => 0 }, + "has_facets", + { data_type => "tinyint", is_nullable => 0 }, + "has_orphan", + { data_type => "tinyint", is_nullable => 0 }, + "has_binary", + { data_type => "tinyint", is_nullable => 0 }, + "facets", + { data_type => "longtext", is_nullable => 1 }, + "orphan", + { data_type => "longtext", is_nullable => 1 }, + "rendered", + { data_type => "longtext", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("event_id"); +__PACKAGE__->add_unique_constraint("event_uuid", ["event_uuid"]); +__PACKAGE__->add_unique_constraint("job_try_id", ["job_try_id", "event_idx", "event_sdx"]); +__PACKAGE__->has_many( + "binaries", + "App::Yath::Schema::Result::Binary", + { "foreign.event_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parent_uuids", + "App::Yath::Schema::Result::Event", + { "foreign.parent_uuid" => "self.event_uuid" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parents", + "App::Yath::Schema::Result::Event", + { "foreign.parent_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "parent", + "App::Yath::Schema::Result::Event", + { event_id => "parent_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "parent_uuid", + "App::Yath::Schema::Result::Event", + { event_uuid => "parent_uuid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Event - Autogenerated result class for Event in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Host.pm b/lib/App/Yath/Schema/MariaDB/Host.pm new file mode 100644 index 000000000..59c43fb08 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Host.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MariaDB::Host; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Host; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("hosts"); +__PACKAGE__->add_columns( + "host_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "hostname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("host_id"); +__PACKAGE__->add_unique_constraint("hostname", ["hostname"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.host_id" => "self.host_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Host - Autogenerated result class for Host in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Job.pm b/lib/App/Yath/Schema/MariaDB/Job.pm new file mode 100644 index 000000000..9d98dfb59 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Job.pm @@ -0,0 +1,105 @@ +use utf8; +package App::Yath::Schema::MariaDB::Job; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Job; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("jobs"); +__PACKAGE__->add_columns( + "job_uuid", + { data_type => "uuid", is_nullable => 0 }, + "job_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "is_harness_out", + { data_type => "tinyint", is_nullable => 0 }, + "failed", + { data_type => "tinyint", is_nullable => 0 }, + "passed", + { data_type => "tinyint", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_id"); +__PACKAGE__->add_unique_constraint("job_uuid", ["job_uuid"]); +__PACKAGE__->has_many( + "jobs_tries", + "App::Yath::Schema::Result::JobTry", + { "foreign.job_id" => "self.job_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Job - Autogenerated result class for Job in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/JobTry.pm b/lib/App/Yath/Schema/MariaDB/JobTry.pm new file mode 100644 index 000000000..7efcb8a2c --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/JobTry.pm @@ -0,0 +1,154 @@ +use utf8; +package App::Yath::Schema::MariaDB::JobTry; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTry; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_tries"); +__PACKAGE__->add_columns( + "job_try_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "pass_count", + { data_type => "bigint", is_nullable => 1 }, + "fail_count", + { data_type => "bigint", is_nullable => 1 }, + "exit_code", + { data_type => "integer", is_nullable => 1 }, + "launch", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "start", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "ended", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "status", + { + data_type => "enum", + default_value => "pending", + extra => { + list => ["pending", "running", "complete", "broken", "canceled"], + }, + is_nullable => 0, + }, + "job_try_ord", + { data_type => "smallint", is_nullable => 0 }, + "fail", + { data_type => "tinyint", is_nullable => 1 }, + "retry", + { data_type => "tinyint", is_nullable => 1 }, + "duration", + { data_type => "decimal", is_nullable => 1, size => [14, 4] }, + "parameters", + { data_type => "longtext", is_nullable => 1 }, + "stdout", + { data_type => "text", is_nullable => 1 }, + "stderr", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_try_id"); +__PACKAGE__->add_unique_constraint("job_try_id", ["job_try_id", "job_try_ord"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events", + "App::Yath::Schema::Result::Event", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job", + "App::Yath::Schema::Result::Job", + { job_id => "job_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->has_many( + "job_try_fields", + "App::Yath::Schema::Result::JobTryField", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::JobTry - Autogenerated result class for JobTry in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/JobTryField.pm b/lib/App/Yath/Schema/MariaDB/JobTryField.pm new file mode 100644 index 000000000..23be8ad20 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/JobTryField.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::MariaDB::JobTryField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTryField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_try_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "job_field_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "longtext", is_nullable => 1 }, + "details", + { data_type => "text", is_nullable => 1 }, + "raw", + { data_type => "text", is_nullable => 1 }, + "link", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_field_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::JobTryField - Autogenerated result class for JobTryField in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/LogFile.pm b/lib/App/Yath/Schema/MariaDB/LogFile.pm new file mode 100644 index 000000000..315809961 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/LogFile.pm @@ -0,0 +1,86 @@ +use utf8; +package App::Yath::Schema::MariaDB::LogFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::LogFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("log_files"); +__PACKAGE__->add_columns( + "log_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, + "local_file", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("log_file_id"); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.log_file_id" => "self.log_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::LogFile - Autogenerated result class for LogFile in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Permission.pm b/lib/App/Yath/Schema/MariaDB/Permission.pm new file mode 100644 index 000000000..9fdad35c9 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Permission.pm @@ -0,0 +1,98 @@ +use utf8; +package App::Yath::Schema::MariaDB::Permission; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Permission; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("permissions"); +__PACKAGE__->add_columns( + "permission_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "updated", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("permission_id"); +__PACKAGE__->add_unique_constraint("project_id", ["project_id", "user_id"]); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Permission - Autogenerated result class for Permission in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/PrimaryEmail.pm b/lib/App/Yath/Schema/MariaDB/PrimaryEmail.pm new file mode 100644 index 000000000..f2a78ec9a --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/PrimaryEmail.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::MariaDB::PrimaryEmail; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::PrimaryEmail; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("primary_email"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("email_id", ["email_id"]); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::PrimaryEmail - Autogenerated result class for PrimaryEmail in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Project.pm b/lib/App/Yath/Schema/MariaDB/Project.pm new file mode 100644 index 000000000..a3198d1c1 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Project.pm @@ -0,0 +1,108 @@ +use utf8; +package App::Yath::Schema::MariaDB::Project; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Project; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("projects"); +__PACKAGE__->add_columns( + "project_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "owner", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("project_id"); +__PACKAGE__->add_unique_constraint("name", ["name"]); +__PACKAGE__->belongs_to( + "owner", + "App::Yath::Schema::Result::User", + { user_id => "owner" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Project - Autogenerated result class for Project in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Reporting.pm b/lib/App/Yath/Schema/MariaDB/Reporting.pm new file mode 100644 index 000000000..6a20e6832 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Reporting.pm @@ -0,0 +1,138 @@ +use utf8; +package App::Yath::Schema::MariaDB::Reporting; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Reporting; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("reporting"); +__PACKAGE__->add_columns( + "reporting_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "job_try", + { data_type => "smallint", is_nullable => 1 }, + "retry", + { data_type => "smallint", is_nullable => 0 }, + "abort", + { data_type => "smallint", is_nullable => 0 }, + "fail", + { data_type => "smallint", is_nullable => 0 }, + "pass", + { data_type => "smallint", is_nullable => 0 }, + "subtest", + { data_type => "varchar", is_nullable => 1, size => 512 }, + "duration", + { data_type => "decimal", is_nullable => 0, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("reporting_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Reporting - Autogenerated result class for Reporting in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Resource.pm b/lib/App/Yath/Schema/MariaDB/Resource.pm new file mode 100644 index 000000000..b7cfc5107 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Resource.pm @@ -0,0 +1,116 @@ +use utf8; +package App::Yath::Schema::MariaDB::Resource; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Resource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resources"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "resource_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "resource_type_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "host_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "stamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 0, + }, + "resource_ord", + { data_type => "integer", is_nullable => 0 }, + "data", + { data_type => "longtext", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("resource_id"); +__PACKAGE__->add_unique_constraint("run_id", ["run_id", "resource_ord"]); +__PACKAGE__->belongs_to( + "host", + "App::Yath::Schema::Result::Host", + { host_id => "host_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "resource_type", + "App::Yath::Schema::Result::ResourceType", + { resource_type_id => "resource_type_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Resource - Autogenerated result class for Resource in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/ResourceType.pm b/lib/App/Yath/Schema/MariaDB/ResourceType.pm new file mode 100644 index 000000000..d82844afa --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/ResourceType.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MariaDB::ResourceType; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ResourceType; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resource_types"); +__PACKAGE__->add_columns( + "resource_type_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("resource_type_id"); +__PACKAGE__->add_unique_constraint("name", ["name"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.resource_type_id" => "self.resource_type_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::ResourceType - Autogenerated result class for ResourceType in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Run.pm b/lib/App/Yath/Schema/MariaDB/Run.pm new file mode 100644 index 000000000..da207ccec --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Run.pm @@ -0,0 +1,206 @@ +use utf8; +package App::Yath::Schema::MariaDB::Run; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Run; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("runs"); +__PACKAGE__->add_columns( + "run_uuid", + { data_type => "uuid", is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "log_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "sync_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "passed", + { data_type => "integer", is_nullable => 1 }, + "failed", + { data_type => "integer", is_nullable => 1 }, + "to_retry", + { data_type => "integer", is_nullable => 1 }, + "retried", + { data_type => "integer", is_nullable => 1 }, + "concurrency_j", + { data_type => "integer", is_nullable => 1 }, + "concurrency_x", + { data_type => "integer", is_nullable => 1 }, + "added", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "status", + { + data_type => "enum", + default_value => "pending", + extra => { + list => ["pending", "running", "complete", "broken", "canceled"], + }, + is_nullable => 0, + }, + "mode", + { + data_type => "enum", + default_value => "qvfd", + extra => { list => ["qvfds", "qvfd", "qvf", "summary", "complete"] }, + is_nullable => 0, + }, + "canon", + { data_type => "tinyint", is_nullable => 0 }, + "pinned", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "has_coverage", + { data_type => "tinyint", is_nullable => 1 }, + "has_resources", + { data_type => "tinyint", is_nullable => 1 }, + "parameters", + { data_type => "longtext", is_nullable => 1 }, + "worker_id", + { data_type => "text", is_nullable => 1 }, + "error", + { data_type => "text", is_nullable => 1 }, + "duration", + { data_type => "decimal", is_nullable => 1, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("run_id"); +__PACKAGE__->add_unique_constraint("run_uuid", ["run_uuid"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "log_file", + "App::Yath::Schema::Result::LogFile", + { log_file_id => "log_file_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "run_fields", + "App::Yath::Schema::Result::RunField", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "sweeps", + "App::Yath::Schema::Result::Sweep", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "sync", + "App::Yath::Schema::Result::Sync", + { sync_id => "sync_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Run - Autogenerated result class for Run in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/RunField.pm b/lib/App/Yath/Schema/MariaDB/RunField.pm new file mode 100644 index 000000000..66fc36a5f --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/RunField.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::MariaDB::RunField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::RunField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("run_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "run_field_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "longtext", is_nullable => 1 }, + "details", + { data_type => "text", is_nullable => 1 }, + "raw", + { data_type => "text", is_nullable => 1 }, + "link", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("run_field_id"); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::RunField - Autogenerated result class for RunField in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Session.pm b/lib/App/Yath/Schema/MariaDB/Session.pm new file mode 100644 index 000000000..42a44885d --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Session.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::MariaDB::Session; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Session; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sessions"); +__PACKAGE__->add_columns( + "session_uuid", + { data_type => "uuid", is_nullable => 0 }, + "session_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "active", + { data_type => "tinyint", default_value => 1, is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("session_id"); +__PACKAGE__->add_unique_constraint("session_uuid", ["session_uuid"]); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.session_id" => "self.session_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Session - Autogenerated result class for Session in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/SessionHost.pm b/lib/App/Yath/Schema/MariaDB/SessionHost.pm new file mode 100644 index 000000000..a38d9c33e --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/SessionHost.pm @@ -0,0 +1,114 @@ +use utf8; +package App::Yath::Schema::MariaDB::SessionHost; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SessionHost; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("session_hosts"); +__PACKAGE__->add_columns( + "session_host_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "session_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "created", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "accessed", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "address", + { data_type => "text", is_nullable => 0 }, + "agent", + { data_type => "text", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("session_host_id"); +__PACKAGE__->add_unique_constraint("address", ["address", "agent", "session_id"]); +__PACKAGE__->belongs_to( + "session", + "App::Yath::Schema::Result::Session", + { session_id => "session_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::SessionHost - Autogenerated result class for SessionHost in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/SourceFile.pm b/lib/App/Yath/Schema/MariaDB/SourceFile.pm new file mode 100644 index 000000000..8186985d1 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/SourceFile.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MariaDB::SourceFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_files"); +__PACKAGE__->add_columns( + "source_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_file_id"); +__PACKAGE__->add_unique_constraint("filename", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_file_id" => "self.source_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::SourceFile - Autogenerated result class for SourceFile in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/SourceSub.pm b/lib/App/Yath/Schema/MariaDB/SourceSub.pm new file mode 100644 index 000000000..c153a9567 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/SourceSub.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MariaDB::SourceSub; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceSub; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_subs"); +__PACKAGE__->add_columns( + "source_sub_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "subname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_sub_id"); +__PACKAGE__->add_unique_constraint("subname", ["subname"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_sub_id" => "self.source_sub_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::SourceSub - Autogenerated result class for SourceSub in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Sweep.pm b/lib/App/Yath/Schema/MariaDB/Sweep.pm new file mode 100644 index 000000000..c8519dcd9 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Sweep.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::MariaDB::Sweep; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sweep; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sweeps"); +__PACKAGE__->add_columns( + "sweep_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sweep_id"); +__PACKAGE__->add_unique_constraint("run_id", ["run_id", "name"]); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Sweep - Autogenerated result class for Sweep in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Sync.pm b/lib/App/Yath/Schema/MariaDB/Sync.pm new file mode 100644 index 000000000..c43b03be5 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Sync.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::MariaDB::Sync; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sync; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("syncs"); +__PACKAGE__->add_columns( + "sync_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "last_run_id", + { data_type => "bigint", is_nullable => 0 }, + "last_project_id", + { data_type => "bigint", is_nullable => 0 }, + "last_user_id", + { data_type => "bigint", is_nullable => 0 }, + "source", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sync_id"); +__PACKAGE__->add_unique_constraint("source", ["source"]); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.sync_id" => "self.sync_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Sync - Autogenerated result class for Sync in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/TestFile.pm b/lib/App/Yath/Schema/MariaDB/TestFile.pm new file mode 100644 index 000000000..09755003c --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/TestFile.pm @@ -0,0 +1,95 @@ +use utf8; +package App::Yath::Schema::MariaDB::TestFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::TestFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("test_files"); +__PACKAGE__->add_columns( + "test_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); +__PACKAGE__->set_primary_key("test_file_id"); +__PACKAGE__->add_unique_constraint("filename", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::TestFile - Autogenerated result class for TestFile in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/User.pm b/lib/App/Yath/Schema/MariaDB/User.pm new file mode 100644 index 000000000..763f6fd58 --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/User.pm @@ -0,0 +1,138 @@ +use utf8; +package App::Yath::Schema::MariaDB::User; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::User; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("users"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "pw_hash", + { data_type => "varchar", is_nullable => 1, size => 31 }, + "pw_salt", + { data_type => "varchar", is_nullable => 1, size => 22 }, + "role", + { + data_type => "enum", + default_value => "user", + extra => { list => ["admin", "user"] }, + is_nullable => 0, + }, + "username", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "realname", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("username", ["username"]); +__PACKAGE__->has_many( + "api_keys", + "App::Yath::Schema::Result::ApiKey", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "emails", + "App::Yath::Schema::Result::Email", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "projects", + "App::Yath::Schema::Result::Project", + { "foreign.owner" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::User - Autogenerated result class for User in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MariaDB/Version.pm b/lib/App/Yath/Schema/MariaDB/Version.pm new file mode 100644 index 000000000..1e210b5bd --- /dev/null +++ b/lib/App/Yath/Schema/MariaDB/Version.pm @@ -0,0 +1,84 @@ +use utf8; +package App::Yath::Schema::MariaDB::Version; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Version; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("versions"); +__PACKAGE__->add_columns( + "version", + { data_type => "decimal", is_nullable => 0, size => [10, 6] }, + "version_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "updated", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("version_id"); +__PACKAGE__->add_unique_constraint("version", ["version"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:09 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MariaDB::Version - Autogenerated result class for Version in MariaDB. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/ApiKey.pm b/lib/App/Yath/Schema/MySQL/ApiKey.pm new file mode 100644 index 000000000..289848e80 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/ApiKey.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::MySQL::ApiKey; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ApiKey; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("api_keys"); +__PACKAGE__->add_columns( + "value", + { data_type => "uuid", is_nullable => 0 }, + "api_key_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "status", + { + data_type => "enum", + default_value => "active", + extra => { list => ["active", "disabled", "revoked"] }, + is_nullable => 0, + }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("api_key_id"); +__PACKAGE__->add_unique_constraint("value", ["value"]); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::ApiKey - Autogenerated result class for ApiKey in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Binary.pm b/lib/App/Yath/Schema/MySQL/Binary.pm new file mode 100644 index 000000000..8bf5ec475 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Binary.pm @@ -0,0 +1,97 @@ +use utf8; +package App::Yath::Schema::MySQL::Binary; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Binary; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("binaries"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "binary_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "event_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "is_image", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, + "description", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("binary_id"); +__PACKAGE__->belongs_to( + "event", + "App::Yath::Schema::Result::Event", + { event_id => "event_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Binary - Autogenerated result class for Binary in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Config.pm b/lib/App/Yath/Schema/MySQL/Config.pm new file mode 100644 index 000000000..1f484e46b --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Config.pm @@ -0,0 +1,79 @@ +use utf8; +package App::Yath::Schema::MySQL::Config; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Config; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("config"); +__PACKAGE__->add_columns( + "config_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "setting", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "value", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("config_id"); +__PACKAGE__->add_unique_constraint("setting", ["setting"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Config - Autogenerated result class for Config in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Coverage.pm b/lib/App/Yath/Schema/MySQL/Coverage.pm new file mode 100644 index 000000000..1a0187ffe --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Coverage.pm @@ -0,0 +1,146 @@ +use utf8; +package App::Yath::Schema::MySQL::Coverage; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Coverage; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "coverage_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "coverage_manager_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "source_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "source_sub_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "metadata", + { data_type => "longtext", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("coverage_id"); +__PACKAGE__->add_unique_constraint( + "run_id", + [ + "run_id", + "job_try_id", + "test_file_id", + "source_file_id", + "source_sub_id", + ], +); +__PACKAGE__->belongs_to( + "coverage_manager", + "App::Yath::Schema::Result::CoverageManager", + { coverage_manager_id => "coverage_manager_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "source_file", + "App::Yath::Schema::Result::SourceFile", + { source_file_id => "source_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "source_sub", + "App::Yath::Schema::Result::SourceSub", + { source_sub_id => "source_sub_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Coverage - Autogenerated result class for Coverage in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/CoverageManager.pm b/lib/App/Yath/Schema/MySQL/CoverageManager.pm new file mode 100644 index 000000000..621b95570 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/CoverageManager.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MySQL::CoverageManager; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::CoverageManager; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage_manager"); +__PACKAGE__->add_columns( + "coverage_manager_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "package", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("coverage_manager_id"); +__PACKAGE__->add_unique_constraint("package", ["package"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.coverage_manager_id" => "self.coverage_manager_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::CoverageManager - Autogenerated result class for CoverageManager in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Email.pm b/lib/App/Yath/Schema/MySQL/Email.pm new file mode 100644 index 000000000..d4bc31a7d --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Email.pm @@ -0,0 +1,101 @@ +use utf8; +package App::Yath::Schema::MySQL::Email; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Email; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email"); +__PACKAGE__->add_columns( + "email_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "verified", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "local", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "domain", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->add_unique_constraint("local", ["local", "domain"]); +__PACKAGE__->might_have( + "email_verification_code", + "App::Yath::Schema::Result::EmailVerificationCode", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Email - Autogenerated result class for Email in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/EmailVerificationCode.pm b/lib/App/Yath/Schema/MySQL/EmailVerificationCode.pm new file mode 100644 index 000000000..9358c7957 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/EmailVerificationCode.pm @@ -0,0 +1,82 @@ +use utf8; +package App::Yath::Schema::MySQL::EmailVerificationCode; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::EmailVerificationCode; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email_verification_codes"); +__PACKAGE__->add_columns( + "evcode", + { data_type => "uuid", is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::EmailVerificationCode - Autogenerated result class for EmailVerificationCode in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Event.pm b/lib/App/Yath/Schema/MySQL/Event.pm new file mode 100644 index 000000000..52350192b --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Event.pm @@ -0,0 +1,166 @@ +use utf8; +package App::Yath::Schema::MySQL::Event; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Event; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("events"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "trace_uuid", + { data_type => "uuid", is_nullable => 1 }, + "parent_uuid", + { data_type => "uuid", is_foreign_key => 1, is_nullable => 1 }, + "event_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "parent_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "event_idx", + { data_type => "integer", is_nullable => 0 }, + "event_sdx", + { data_type => "integer", is_nullable => 0 }, + "stamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "nested", + { data_type => "smallint", is_nullable => 0 }, + "is_subtest", + { data_type => "tinyint", is_nullable => 0 }, + "is_diag", + { data_type => "tinyint", is_nullable => 0 }, + "is_harness", + { data_type => "tinyint", is_nullable => 0 }, + "is_time", + { data_type => "tinyint", is_nullable => 0 }, + "causes_fail", + { data_type => "tinyint", is_nullable => 0 }, + "has_facets", + { data_type => "tinyint", is_nullable => 0 }, + "has_orphan", + { data_type => "tinyint", is_nullable => 0 }, + "has_binary", + { data_type => "tinyint", is_nullable => 0 }, + "facets", + { data_type => "longtext", is_nullable => 1 }, + "orphan", + { data_type => "longtext", is_nullable => 1 }, + "rendered", + { data_type => "longtext", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("event_id"); +__PACKAGE__->add_unique_constraint("event_uuid", ["event_uuid"]); +__PACKAGE__->add_unique_constraint("job_try_id", ["job_try_id", "event_idx", "event_sdx"]); +__PACKAGE__->has_many( + "binaries", + "App::Yath::Schema::Result::Binary", + { "foreign.event_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parent_uuids", + "App::Yath::Schema::Result::Event", + { "foreign.parent_uuid" => "self.event_uuid" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parents", + "App::Yath::Schema::Result::Event", + { "foreign.parent_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "parent", + "App::Yath::Schema::Result::Event", + { event_id => "parent_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "parent_uuid", + "App::Yath::Schema::Result::Event", + { event_uuid => "parent_uuid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Event - Autogenerated result class for Event in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Host.pm b/lib/App/Yath/Schema/MySQL/Host.pm new file mode 100644 index 000000000..864122ad5 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Host.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MySQL::Host; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Host; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("hosts"); +__PACKAGE__->add_columns( + "host_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "hostname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("host_id"); +__PACKAGE__->add_unique_constraint("hostname", ["hostname"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.host_id" => "self.host_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Host - Autogenerated result class for Host in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Job.pm b/lib/App/Yath/Schema/MySQL/Job.pm new file mode 100644 index 000000000..d5210bd6b --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Job.pm @@ -0,0 +1,105 @@ +use utf8; +package App::Yath::Schema::MySQL::Job; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Job; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("jobs"); +__PACKAGE__->add_columns( + "job_uuid", + { data_type => "uuid", is_nullable => 0 }, + "job_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "is_harness_out", + { data_type => "tinyint", is_nullable => 0 }, + "failed", + { data_type => "tinyint", is_nullable => 0 }, + "passed", + { data_type => "tinyint", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_id"); +__PACKAGE__->add_unique_constraint("job_uuid", ["job_uuid"]); +__PACKAGE__->has_many( + "jobs_tries", + "App::Yath::Schema::Result::JobTry", + { "foreign.job_id" => "self.job_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Job - Autogenerated result class for Job in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/JobTry.pm b/lib/App/Yath/Schema/MySQL/JobTry.pm new file mode 100644 index 000000000..a92981354 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/JobTry.pm @@ -0,0 +1,154 @@ +use utf8; +package App::Yath::Schema::MySQL::JobTry; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTry; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_tries"); +__PACKAGE__->add_columns( + "job_try_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "pass_count", + { data_type => "bigint", is_nullable => 1 }, + "fail_count", + { data_type => "bigint", is_nullable => 1 }, + "exit_code", + { data_type => "integer", is_nullable => 1 }, + "launch", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "start", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "ended", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "status", + { + data_type => "enum", + default_value => "pending", + extra => { + list => ["pending", "running", "complete", "broken", "canceled"], + }, + is_nullable => 0, + }, + "job_try_ord", + { data_type => "smallint", is_nullable => 0 }, + "fail", + { data_type => "tinyint", is_nullable => 1 }, + "retry", + { data_type => "tinyint", is_nullable => 1 }, + "duration", + { data_type => "decimal", is_nullable => 1, size => [14, 4] }, + "parameters", + { data_type => "longtext", is_nullable => 1 }, + "stdout", + { data_type => "text", is_nullable => 1 }, + "stderr", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_try_id"); +__PACKAGE__->add_unique_constraint("job_try_id", ["job_try_id", "job_try_ord"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events", + "App::Yath::Schema::Result::Event", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job", + "App::Yath::Schema::Result::Job", + { job_id => "job_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->has_many( + "job_try_fields", + "App::Yath::Schema::Result::JobTryField", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::JobTry - Autogenerated result class for JobTry in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/JobTryField.pm b/lib/App/Yath/Schema/MySQL/JobTryField.pm new file mode 100644 index 000000000..4b831a012 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/JobTryField.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::MySQL::JobTryField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTryField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_try_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "job_field_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "longtext", is_nullable => 1 }, + "details", + { data_type => "text", is_nullable => 1 }, + "raw", + { data_type => "text", is_nullable => 1 }, + "link", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_field_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::JobTryField - Autogenerated result class for JobTryField in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/LogFile.pm b/lib/App/Yath/Schema/MySQL/LogFile.pm new file mode 100644 index 000000000..011934581 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/LogFile.pm @@ -0,0 +1,86 @@ +use utf8; +package App::Yath::Schema::MySQL::LogFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::LogFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("log_files"); +__PACKAGE__->add_columns( + "log_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, + "local_file", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("log_file_id"); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.log_file_id" => "self.log_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::LogFile - Autogenerated result class for LogFile in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Permission.pm b/lib/App/Yath/Schema/MySQL/Permission.pm new file mode 100644 index 000000000..d51a5ddba --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Permission.pm @@ -0,0 +1,98 @@ +use utf8; +package App::Yath::Schema::MySQL::Permission; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Permission; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("permissions"); +__PACKAGE__->add_columns( + "permission_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "updated", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("permission_id"); +__PACKAGE__->add_unique_constraint("project_id", ["project_id", "user_id"]); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Permission - Autogenerated result class for Permission in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/PrimaryEmail.pm b/lib/App/Yath/Schema/MySQL/PrimaryEmail.pm new file mode 100644 index 000000000..073efab90 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/PrimaryEmail.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::MySQL::PrimaryEmail; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::PrimaryEmail; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("primary_email"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("email_id", ["email_id"]); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::PrimaryEmail - Autogenerated result class for PrimaryEmail in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Project.pm b/lib/App/Yath/Schema/MySQL/Project.pm new file mode 100644 index 000000000..e3c22f16d --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Project.pm @@ -0,0 +1,108 @@ +use utf8; +package App::Yath::Schema::MySQL::Project; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Project; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("projects"); +__PACKAGE__->add_columns( + "project_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "owner", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("project_id"); +__PACKAGE__->add_unique_constraint("name", ["name"]); +__PACKAGE__->belongs_to( + "owner", + "App::Yath::Schema::Result::User", + { user_id => "owner" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Project - Autogenerated result class for Project in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Reporting.pm b/lib/App/Yath/Schema/MySQL/Reporting.pm new file mode 100644 index 000000000..8948b339b --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Reporting.pm @@ -0,0 +1,138 @@ +use utf8; +package App::Yath::Schema::MySQL::Reporting; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Reporting; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("reporting"); +__PACKAGE__->add_columns( + "reporting_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "job_try", + { data_type => "smallint", is_nullable => 1 }, + "retry", + { data_type => "smallint", is_nullable => 0 }, + "abort", + { data_type => "smallint", is_nullable => 0 }, + "fail", + { data_type => "smallint", is_nullable => 0 }, + "pass", + { data_type => "smallint", is_nullable => 0 }, + "subtest", + { data_type => "varchar", is_nullable => 1, size => 512 }, + "duration", + { data_type => "decimal", is_nullable => 0, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("reporting_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Reporting - Autogenerated result class for Reporting in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Resource.pm b/lib/App/Yath/Schema/MySQL/Resource.pm new file mode 100644 index 000000000..ee5e09152 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Resource.pm @@ -0,0 +1,116 @@ +use utf8; +package App::Yath::Schema::MySQL::Resource; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Resource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resources"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "resource_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "resource_type_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "host_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "stamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 0, + }, + "resource_ord", + { data_type => "integer", is_nullable => 0 }, + "data", + { data_type => "longtext", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("resource_id"); +__PACKAGE__->add_unique_constraint("run_id", ["run_id", "resource_ord"]); +__PACKAGE__->belongs_to( + "host", + "App::Yath::Schema::Result::Host", + { host_id => "host_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "resource_type", + "App::Yath::Schema::Result::ResourceType", + { resource_type_id => "resource_type_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Resource - Autogenerated result class for Resource in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/ResourceType.pm b/lib/App/Yath/Schema/MySQL/ResourceType.pm new file mode 100644 index 000000000..c5eb602b3 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/ResourceType.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MySQL::ResourceType; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ResourceType; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resource_types"); +__PACKAGE__->add_columns( + "resource_type_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("resource_type_id"); +__PACKAGE__->add_unique_constraint("name", ["name"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.resource_type_id" => "self.resource_type_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::ResourceType - Autogenerated result class for ResourceType in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Run.pm b/lib/App/Yath/Schema/MySQL/Run.pm new file mode 100644 index 000000000..e125d8b86 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Run.pm @@ -0,0 +1,206 @@ +use utf8; +package App::Yath::Schema::MySQL::Run; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Run; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("runs"); +__PACKAGE__->add_columns( + "run_uuid", + { data_type => "uuid", is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "log_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "sync_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "passed", + { data_type => "integer", is_nullable => 1 }, + "failed", + { data_type => "integer", is_nullable => 1 }, + "to_retry", + { data_type => "integer", is_nullable => 1 }, + "retried", + { data_type => "integer", is_nullable => 1 }, + "concurrency_j", + { data_type => "integer", is_nullable => 1 }, + "concurrency_x", + { data_type => "integer", is_nullable => 1 }, + "added", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "status", + { + data_type => "enum", + default_value => "pending", + extra => { + list => ["pending", "running", "complete", "broken", "canceled"], + }, + is_nullable => 0, + }, + "mode", + { + data_type => "enum", + default_value => "qvfd", + extra => { list => ["qvfds", "qvfd", "qvf", "summary", "complete"] }, + is_nullable => 0, + }, + "canon", + { data_type => "tinyint", is_nullable => 0 }, + "pinned", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "has_coverage", + { data_type => "tinyint", is_nullable => 1 }, + "has_resources", + { data_type => "tinyint", is_nullable => 1 }, + "parameters", + { data_type => "longtext", is_nullable => 1 }, + "worker_id", + { data_type => "text", is_nullable => 1 }, + "error", + { data_type => "text", is_nullable => 1 }, + "duration", + { data_type => "decimal", is_nullable => 1, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("run_id"); +__PACKAGE__->add_unique_constraint("run_uuid", ["run_uuid"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "log_file", + "App::Yath::Schema::Result::LogFile", + { log_file_id => "log_file_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "run_fields", + "App::Yath::Schema::Result::RunField", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "sweeps", + "App::Yath::Schema::Result::Sweep", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "sync", + "App::Yath::Schema::Result::Sync", + { sync_id => "sync_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Run - Autogenerated result class for Run in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/RunField.pm b/lib/App/Yath/Schema/MySQL/RunField.pm new file mode 100644 index 000000000..4caac0c19 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/RunField.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::MySQL::RunField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::RunField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("run_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "run_field_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "longtext", is_nullable => 1 }, + "details", + { data_type => "text", is_nullable => 1 }, + "raw", + { data_type => "text", is_nullable => 1 }, + "link", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("run_field_id"); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::RunField - Autogenerated result class for RunField in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Session.pm b/lib/App/Yath/Schema/MySQL/Session.pm new file mode 100644 index 000000000..47077d2b4 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Session.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::MySQL::Session; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Session; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sessions"); +__PACKAGE__->add_columns( + "session_uuid", + { data_type => "uuid", is_nullable => 0 }, + "session_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "active", + { data_type => "tinyint", default_value => 1, is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("session_id"); +__PACKAGE__->add_unique_constraint("session_uuid", ["session_uuid"]); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.session_id" => "self.session_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Session - Autogenerated result class for Session in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/SessionHost.pm b/lib/App/Yath/Schema/MySQL/SessionHost.pm new file mode 100644 index 000000000..448e09ce5 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/SessionHost.pm @@ -0,0 +1,114 @@ +use utf8; +package App::Yath::Schema::MySQL::SessionHost; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SessionHost; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("session_hosts"); +__PACKAGE__->add_columns( + "session_host_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "session_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "created", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "accessed", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, + "address", + { data_type => "text", is_nullable => 0 }, + "agent", + { data_type => "text", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("session_host_id"); +__PACKAGE__->add_unique_constraint("address", ["address", "agent", "session_id"]); +__PACKAGE__->belongs_to( + "session", + "App::Yath::Schema::Result::Session", + { session_id => "session_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::SessionHost - Autogenerated result class for SessionHost in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/SourceFile.pm b/lib/App/Yath/Schema/MySQL/SourceFile.pm new file mode 100644 index 000000000..707e27431 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/SourceFile.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MySQL::SourceFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_files"); +__PACKAGE__->add_columns( + "source_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_file_id"); +__PACKAGE__->add_unique_constraint("filename", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_file_id" => "self.source_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::SourceFile - Autogenerated result class for SourceFile in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/SourceSub.pm b/lib/App/Yath/Schema/MySQL/SourceSub.pm new file mode 100644 index 000000000..0fa9efbe5 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/SourceSub.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::MySQL::SourceSub; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceSub; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_subs"); +__PACKAGE__->add_columns( + "source_sub_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "subname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_sub_id"); +__PACKAGE__->add_unique_constraint("subname", ["subname"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_sub_id" => "self.source_sub_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::SourceSub - Autogenerated result class for SourceSub in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Sweep.pm b/lib/App/Yath/Schema/MySQL/Sweep.pm new file mode 100644 index 000000000..b33dd7d02 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Sweep.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::MySQL::Sweep; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sweep; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sweeps"); +__PACKAGE__->add_columns( + "sweep_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sweep_id"); +__PACKAGE__->add_unique_constraint("run_id", ["run_id", "name"]); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Sweep - Autogenerated result class for Sweep in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Sync.pm b/lib/App/Yath/Schema/MySQL/Sync.pm new file mode 100644 index 000000000..a66520fc2 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Sync.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::MySQL::Sync; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sync; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("syncs"); +__PACKAGE__->add_columns( + "sync_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "last_run_id", + { data_type => "bigint", is_nullable => 0 }, + "last_project_id", + { data_type => "bigint", is_nullable => 0 }, + "last_user_id", + { data_type => "bigint", is_nullable => 0 }, + "source", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sync_id"); +__PACKAGE__->add_unique_constraint("source", ["source"]); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.sync_id" => "self.sync_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Sync - Autogenerated result class for Sync in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/TestFile.pm b/lib/App/Yath/Schema/MySQL/TestFile.pm new file mode 100644 index 000000000..52223b42a --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/TestFile.pm @@ -0,0 +1,95 @@ +use utf8; +package App::Yath::Schema::MySQL::TestFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::TestFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("test_files"); +__PACKAGE__->add_columns( + "test_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); +__PACKAGE__->set_primary_key("test_file_id"); +__PACKAGE__->add_unique_constraint("filename", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::TestFile - Autogenerated result class for TestFile in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/User.pm b/lib/App/Yath/Schema/MySQL/User.pm new file mode 100644 index 000000000..396442ba3 --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/User.pm @@ -0,0 +1,138 @@ +use utf8; +package App::Yath::Schema::MySQL::User; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::User; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("users"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "pw_hash", + { data_type => "varchar", is_nullable => 1, size => 31 }, + "pw_salt", + { data_type => "varchar", is_nullable => 1, size => 22 }, + "role", + { + data_type => "enum", + default_value => "user", + extra => { list => ["admin", "user"] }, + is_nullable => 0, + }, + "username", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "realname", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("username", ["username"]); +__PACKAGE__->has_many( + "api_keys", + "App::Yath::Schema::Result::ApiKey", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "emails", + "App::Yath::Schema::Result::Email", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "projects", + "App::Yath::Schema::Result::Project", + { "foreign.owner" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::User - Autogenerated result class for User in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/MySQL/Version.pm b/lib/App/Yath/Schema/MySQL/Version.pm new file mode 100644 index 000000000..ee51ba2ea --- /dev/null +++ b/lib/App/Yath/Schema/MySQL/Version.pm @@ -0,0 +1,84 @@ +use utf8; +package App::Yath::Schema::MySQL::Version; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Version; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("versions"); +__PACKAGE__->add_columns( + "version", + { data_type => "decimal", is_nullable => 0, size => [10, 6] }, + "version_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "updated", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => "current_timestamp()", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("version_id"); +__PACKAGE__->add_unique_constraint("version", ["version"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:11 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::MySQL::Version - Autogenerated result class for Version in MySQL. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Overlay/Event.pm b/lib/App/Yath/Schema/Overlay/Event.pm index e4b82207a..07814afea 100644 --- a/lib/App/Yath/Schema/Overlay/Event.pm +++ b/lib/App/Yath/Schema/Overlay/Event.pm @@ -21,6 +21,20 @@ __PACKAGE__->inflate_column( }, ); +__PACKAGE__->inflate_column( + facets => { + inflate => DBIx::Class::InflateColumn::Serializer::JSON->get_unfreezer('facets', {}), + deflate => DBIx::Class::InflateColumn::Serializer::JSON->get_freezer('facets', {}), + }, +); + +__PACKAGE__->inflate_column( + orphan => { + inflate => DBIx::Class::InflateColumn::Serializer::JSON->get_unfreezer('orphan', {}), + deflate => DBIx::Class::InflateColumn::Serializer::JSON->get_freezer('orphan', {}), + }, +); + sub run { shift->job->run } sub user { shift->job->run->user } @@ -76,10 +90,15 @@ sub line_data { $out{is_parent} = $is_parent; $out{is_fail} = $causes_fail; - $out{parent_id} = $cols{parent_id} if $cols{parent_id}; - $out{nested} = $cols{nested} // 0; + if ($cols{parent_id}) { + $out{parent_id} = $cols{parent_id}; + $out{parent_uuid} = ref($cols{parent_uuid}) ? $cols{parent_uuid}->event_uuid : $cols{parent_uuid}; + } + + $out{nested} = $cols{nested} // 0; $out{event_id} = $cols{event_id}; + $out{event_uuid} = $cols{event_uuid}; return \%out; } diff --git a/lib/App/Yath/Schema/Overlay/Job.pm b/lib/App/Yath/Schema/Overlay/Job.pm index 6aa55cfdb..05f04af59 100644 --- a/lib/App/Yath/Schema/Overlay/Job.pm +++ b/lib/App/Yath/Schema/Overlay/Job.pm @@ -11,6 +11,8 @@ use Carp qw/confess/; confess "You must first load a App::Yath::Schema::NAME module" unless $App::Yath::Schema::LOADED; +*job_tries = *jobs_tries; + sub file { my $self = shift; my %cols = $self->get_all_fields; @@ -39,46 +41,28 @@ sub short_file { return $file; } -my %COMPLETE_STATUS = (complete => 1, failed => 1, canceled => 1, broken => 1); -#sub complete { return $COMPLETE_STATUS{$_[0]->status} // 0 } -sub complete { 0 } +sub complete { + my $self = shift; + + my @tries = $self->job_tries or return 0; + + my $to_see = 1; + for my $try (@tries) { + $to_see--; + return 0 unless $try->complete; + $to_see++ if $try->retry; + } + + return $to_see ? 0 : 1; +} sub sig { my $self = shift; - return "FIXME"; -# return join ";" => ( -# (map {$self->$_ // ''} qw/name file fail/), -# $parameters ? length($parameters) : (''), -# ($self->job_fields->count), -# ); + my $out = join ';' => map { $_->sig } sort { $a->job_try_ord <=> $b->job_try_ord } $self->jobs_tries; + $out //= ';'; } -#sub short_job_fields { -# my $self = shift; -# my %params = @_; -# -# my @fields = $params{prefetched_fields} ? $self->job_fields : $self->job_fields->search( -# undef, { -# remove_columns => ['data'], -# '+select' => ['data IS NOT NULL AS has_data'], -# '+as' => ['has_data'], -# } -# )->all; -# -# my @out; -# for my $jf (@fields) { -# my $fields = {$jf->get_all_fields}; -# -# my $has_data = delete $fields->{data}; -# $fields->{has_data} //= $has_data ? \'1' : \'0'; -# -# push @out => $fields; -# } -# -# return \@out; -#} - sub TO_JSON { my $self = shift; my %cols = $self->get_all_fields; @@ -86,13 +70,12 @@ sub TO_JSON { $cols{short_file} = $self->short_file; $cols{shortest_file} = $self->shortest_file; - # FIXME? -# $cols{fields} = $self->short_job_fields(prefetched => $cols{prefetched_fields}); - return \%cols; } -my @GLANCE_FIELDS = qw{ exit_code fail fail_count job_key job_try retry name pass_count file status job_idx run_id }; +#my @GLANCE_FIELDS = qw{ exit_code fail fail_count job_key job_try retry name pass_count file status job_idx run_id }; + +my @GLANCE_FIELDS = qw{ job_uuid is_harness_out }; sub glance_data { my $self = shift; @@ -110,9 +93,17 @@ sub glance_data { $data{short_file} = $self->short_file; $data{shortest_file} = $self->shortest_file; -# $data{fields} = $self->short_job_fields(prefetched => $cols{prefetched_fields}); + my @out; + + for my $try ($self->jobs_tries) { + push @out => {%data, %{$try->glance_data}}; + } + + unless (@out) { + push @out => {%data, status => 'pending'} + } - return \%data; + return @out; } 1; diff --git a/lib/App/Yath/Schema/Overlay/JobTry.pm b/lib/App/Yath/Schema/Overlay/JobTry.pm index 5c4b83b9c..7969353a6 100644 --- a/lib/App/Yath/Schema/Overlay/JobTry.pm +++ b/lib/App/Yath/Schema/Overlay/JobTry.pm @@ -44,6 +44,57 @@ sub normalize_to_mode { $self->events->search($query)->delete(); } +sub short_job_try_fields { + my $self = shift; + my %params = @_; + + my @fields = $params{prefetched_fields} ? $self->job_try_fields : $self->job_try_fields->search( + undef, { + remove_columns => ['data'], + '+select' => ['data IS NOT NULL AS has_data'], + '+as' => ['has_data'], + } + )->all; + + my @out; + for my $jf (@fields) { + my $fields = {$jf->get_all_fields}; + + my $has_data = delete $fields->{data}; + $fields->{has_data} //= $has_data ? \'1' : \'0'; + + push @out => $fields; + } + + return \@out; +} + +my @GLANCE_FIELDS = qw{ exit_code fail job_try_ord job_try_id retry fail_count pass_count status duration }; + +sub sig { + my $self = shift; + + my %cols = $self->get_all_fields; + + return join ':' => map { $_ // '' } @cols{@GLANCE_FIELDS}; +} + +sub glance_data { + my $self = shift; + my %params = @_; + + my %cols = $self->get_all_fields; + + my %data; + @data{@GLANCE_FIELDS} = @cols{@GLANCE_FIELDS}; + + $data{fields} = $self->short_job_try_fields; + + return \%data; +} + +my %COMPLETE_STATUS = (complete => 1, failed => 1, canceled => 1, broken => 1); +sub complete { return $COMPLETE_STATUS{$_[0]->status} // 0 } 1; diff --git a/lib/App/Yath/Schema/Percona/ApiKey.pm b/lib/App/Yath/Schema/Percona/ApiKey.pm new file mode 100644 index 000000000..98e080c26 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/ApiKey.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::Percona::ApiKey; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ApiKey; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("api_keys"); +__PACKAGE__->add_columns( + "value", + { data_type => "binary", is_nullable => 0, size => 16 }, + "api_key_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "status", + { + data_type => "enum", + default_value => "active", + extra => { list => ["active", "disabled", "revoked"] }, + is_nullable => 0, + }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("api_key_id"); +__PACKAGE__->add_unique_constraint("value", ["value"]); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::ApiKey - Autogenerated result class for ApiKey in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Binary.pm b/lib/App/Yath/Schema/Percona/Binary.pm new file mode 100644 index 000000000..2a5e6a35d --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Binary.pm @@ -0,0 +1,98 @@ +use utf8; +package App::Yath::Schema::Percona::Binary; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Binary; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("binaries"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "binary_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "event_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "is_image", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, + "description", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("binary_id"); +__PACKAGE__->belongs_to( + "event", + "App::Yath::Schema::Result::Event", + { event_id => "event_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('event_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Binary - Autogenerated result class for Binary in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Config.pm b/lib/App/Yath/Schema/Percona/Config.pm new file mode 100644 index 000000000..ec5b48acd --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Config.pm @@ -0,0 +1,79 @@ +use utf8; +package App::Yath::Schema::Percona::Config; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Config; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("config"); +__PACKAGE__->add_columns( + "config_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "setting", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "value", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("config_id"); +__PACKAGE__->add_unique_constraint("setting", ["setting"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Config - Autogenerated result class for Config in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Coverage.pm b/lib/App/Yath/Schema/Percona/Coverage.pm new file mode 100644 index 000000000..b772a9822 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Coverage.pm @@ -0,0 +1,147 @@ +use utf8; +package App::Yath::Schema::Percona::Coverage; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Coverage; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "coverage_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "coverage_manager_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "source_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "source_sub_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "metadata", + { data_type => "json", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("coverage_id"); +__PACKAGE__->add_unique_constraint( + "run_id", + [ + "run_id", + "job_try_id", + "test_file_id", + "source_file_id", + "source_sub_id", + ], +); +__PACKAGE__->belongs_to( + "coverage_manager", + "App::Yath::Schema::Result::CoverageManager", + { coverage_manager_id => "coverage_manager_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "source_file", + "App::Yath::Schema::Result::SourceFile", + { source_file_id => "source_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "source_sub", + "App::Yath::Schema::Result::SourceSub", + { source_sub_id => "source_sub_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('event_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Coverage - Autogenerated result class for Coverage in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/CoverageManager.pm b/lib/App/Yath/Schema/Percona/CoverageManager.pm new file mode 100644 index 000000000..aa7dbf7c9 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/CoverageManager.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::Percona::CoverageManager; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::CoverageManager; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage_manager"); +__PACKAGE__->add_columns( + "coverage_manager_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "package", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("coverage_manager_id"); +__PACKAGE__->add_unique_constraint("package", ["package"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.coverage_manager_id" => "self.coverage_manager_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::CoverageManager - Autogenerated result class for CoverageManager in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Email.pm b/lib/App/Yath/Schema/Percona/Email.pm new file mode 100644 index 000000000..2db6319da --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Email.pm @@ -0,0 +1,101 @@ +use utf8; +package App::Yath::Schema::Percona::Email; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Email; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email"); +__PACKAGE__->add_columns( + "email_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "verified", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "local", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "domain", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->add_unique_constraint("local", ["local", "domain"]); +__PACKAGE__->might_have( + "email_verification_code", + "App::Yath::Schema::Result::EmailVerificationCode", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Email - Autogenerated result class for Email in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/EmailVerificationCode.pm b/lib/App/Yath/Schema/Percona/EmailVerificationCode.pm new file mode 100644 index 000000000..5b9596ec7 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/EmailVerificationCode.pm @@ -0,0 +1,82 @@ +use utf8; +package App::Yath::Schema::Percona::EmailVerificationCode; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::EmailVerificationCode; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email_verification_codes"); +__PACKAGE__->add_columns( + "evcode", + { data_type => "binary", is_nullable => 0, size => 16 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::EmailVerificationCode - Autogenerated result class for EmailVerificationCode in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Event.pm b/lib/App/Yath/Schema/Percona/Event.pm new file mode 100644 index 000000000..07df39482 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Event.pm @@ -0,0 +1,169 @@ +use utf8; +package App::Yath::Schema::Percona::Event; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Event; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("events"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "trace_uuid", + { data_type => "binary", is_nullable => 1, size => 16 }, + "parent_uuid", + { data_type => "binary", is_foreign_key => 1, is_nullable => 1, size => 16 }, + "event_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "parent_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "event_idx", + { data_type => "integer", is_nullable => 0 }, + "event_sdx", + { data_type => "integer", is_nullable => 0 }, + "stamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "nested", + { data_type => "smallint", is_nullable => 0 }, + "is_subtest", + { data_type => "tinyint", is_nullable => 0 }, + "is_diag", + { data_type => "tinyint", is_nullable => 0 }, + "is_harness", + { data_type => "tinyint", is_nullable => 0 }, + "is_time", + { data_type => "tinyint", is_nullable => 0 }, + "causes_fail", + { data_type => "tinyint", is_nullable => 0 }, + "has_facets", + { data_type => "tinyint", is_nullable => 0 }, + "has_orphan", + { data_type => "tinyint", is_nullable => 0 }, + "has_binary", + { data_type => "tinyint", is_nullable => 0 }, + "facets", + { data_type => "json", is_nullable => 1 }, + "orphan", + { data_type => "json", is_nullable => 1 }, + "rendered", + { data_type => "json", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("event_id"); +__PACKAGE__->add_unique_constraint("event_uuid", ["event_uuid"]); +__PACKAGE__->add_unique_constraint("job_try_id", ["job_try_id", "event_idx", "event_sdx"]); +__PACKAGE__->has_many( + "binaries", + "App::Yath::Schema::Result::Binary", + { "foreign.event_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parent_uuids", + "App::Yath::Schema::Result::Event", + { "foreign.parent_uuid" => "self.event_uuid" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parents", + "App::Yath::Schema::Result::Event", + { "foreign.parent_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "parent", + "App::Yath::Schema::Result::Event", + { event_id => "parent_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "parent_uuid", + "App::Yath::Schema::Result::Event", + { event_uuid => "parent_uuid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "RESTRICT", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('event_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +__PACKAGE__->inflate_column('trace_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +__PACKAGE__->inflate_column('parent_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Event - Autogenerated result class for Event in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Host.pm b/lib/App/Yath/Schema/Percona/Host.pm new file mode 100644 index 000000000..e9475de75 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Host.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::Percona::Host; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Host; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("hosts"); +__PACKAGE__->add_columns( + "host_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "hostname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("host_id"); +__PACKAGE__->add_unique_constraint("hostname", ["hostname"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.host_id" => "self.host_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Host - Autogenerated result class for Host in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Job.pm b/lib/App/Yath/Schema/Percona/Job.pm new file mode 100644 index 000000000..a92790fe3 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Job.pm @@ -0,0 +1,106 @@ +use utf8; +package App::Yath::Schema::Percona::Job; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Job; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("jobs"); +__PACKAGE__->add_columns( + "job_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "job_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "is_harness_out", + { data_type => "tinyint", is_nullable => 0 }, + "failed", + { data_type => "tinyint", is_nullable => 0 }, + "passed", + { data_type => "tinyint", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_id"); +__PACKAGE__->add_unique_constraint("job_uuid", ["job_uuid"]); +__PACKAGE__->has_many( + "jobs_tries", + "App::Yath::Schema::Result::JobTry", + { "foreign.job_id" => "self.job_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('job_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Job - Autogenerated result class for Job in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/JobTry.pm b/lib/App/Yath/Schema/Percona/JobTry.pm new file mode 100644 index 000000000..fdd155d22 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/JobTry.pm @@ -0,0 +1,154 @@ +use utf8; +package App::Yath::Schema::Percona::JobTry; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTry; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_tries"); +__PACKAGE__->add_columns( + "job_try_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "pass_count", + { data_type => "bigint", is_nullable => 1 }, + "fail_count", + { data_type => "bigint", is_nullable => 1 }, + "exit_code", + { data_type => "integer", is_nullable => 1 }, + "launch", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "start", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "ended", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "status", + { + data_type => "enum", + default_value => "pending", + extra => { + list => ["pending", "running", "complete", "broken", "canceled"], + }, + is_nullable => 0, + }, + "job_try_ord", + { data_type => "smallint", is_nullable => 0 }, + "fail", + { data_type => "tinyint", is_nullable => 1 }, + "retry", + { data_type => "tinyint", is_nullable => 1 }, + "duration", + { data_type => "decimal", is_nullable => 1, size => [14, 4] }, + "parameters", + { data_type => "json", is_nullable => 1 }, + "stdout", + { data_type => "text", is_nullable => 1 }, + "stderr", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_try_id"); +__PACKAGE__->add_unique_constraint("job_try_id", ["job_try_id", "job_try_ord"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events", + "App::Yath::Schema::Result::Event", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job", + "App::Yath::Schema::Result::Job", + { job_id => "job_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->has_many( + "job_try_fields", + "App::Yath::Schema::Result::JobTryField", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::JobTry - Autogenerated result class for JobTry in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/JobTryField.pm b/lib/App/Yath/Schema/Percona/JobTryField.pm new file mode 100644 index 000000000..6b5ef8b8a --- /dev/null +++ b/lib/App/Yath/Schema/Percona/JobTryField.pm @@ -0,0 +1,95 @@ +use utf8; +package App::Yath::Schema::Percona::JobTryField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTryField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_try_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "job_field_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "json", is_nullable => 1 }, + "details", + { data_type => "text", is_nullable => 1 }, + "raw", + { data_type => "text", is_nullable => 1 }, + "link", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_field_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('event_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::JobTryField - Autogenerated result class for JobTryField in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/LogFile.pm b/lib/App/Yath/Schema/Percona/LogFile.pm new file mode 100644 index 000000000..25ba3b4de --- /dev/null +++ b/lib/App/Yath/Schema/Percona/LogFile.pm @@ -0,0 +1,86 @@ +use utf8; +package App::Yath::Schema::Percona::LogFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::LogFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("log_files"); +__PACKAGE__->add_columns( + "log_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, + "local_file", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("log_file_id"); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.log_file_id" => "self.log_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::LogFile - Autogenerated result class for LogFile in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Permission.pm b/lib/App/Yath/Schema/Percona/Permission.pm new file mode 100644 index 000000000..b9507a126 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Permission.pm @@ -0,0 +1,98 @@ +use utf8; +package App::Yath::Schema::Percona::Permission; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Permission; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("permissions"); +__PACKAGE__->add_columns( + "permission_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "updated", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("permission_id"); +__PACKAGE__->add_unique_constraint("project_id", ["project_id", "user_id"]); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Permission - Autogenerated result class for Permission in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/PrimaryEmail.pm b/lib/App/Yath/Schema/Percona/PrimaryEmail.pm new file mode 100644 index 000000000..d43526ed8 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/PrimaryEmail.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::Percona::PrimaryEmail; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::PrimaryEmail; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("primary_email"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("email_id", ["email_id"]); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::PrimaryEmail - Autogenerated result class for PrimaryEmail in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Project.pm b/lib/App/Yath/Schema/Percona/Project.pm new file mode 100644 index 000000000..d0be65ef7 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Project.pm @@ -0,0 +1,108 @@ +use utf8; +package App::Yath::Schema::Percona::Project; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Project; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("projects"); +__PACKAGE__->add_columns( + "project_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "owner", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("project_id"); +__PACKAGE__->add_unique_constraint("name", ["name"]); +__PACKAGE__->belongs_to( + "owner", + "App::Yath::Schema::Result::User", + { user_id => "owner" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Project - Autogenerated result class for Project in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Reporting.pm b/lib/App/Yath/Schema/Percona/Reporting.pm new file mode 100644 index 000000000..76338580d --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Reporting.pm @@ -0,0 +1,138 @@ +use utf8; +package App::Yath::Schema::Percona::Reporting; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Reporting; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("reporting"); +__PACKAGE__->add_columns( + "reporting_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "test_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "job_try", + { data_type => "smallint", is_nullable => 1 }, + "retry", + { data_type => "smallint", is_nullable => 0 }, + "abort", + { data_type => "smallint", is_nullable => 0 }, + "fail", + { data_type => "smallint", is_nullable => 0 }, + "pass", + { data_type => "smallint", is_nullable => 0 }, + "subtest", + { data_type => "varchar", is_nullable => 1, size => 512 }, + "duration", + { data_type => "decimal", is_nullable => 0, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("reporting_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Reporting - Autogenerated result class for Reporting in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Resource.pm b/lib/App/Yath/Schema/Percona/Resource.pm new file mode 100644 index 000000000..9066cf838 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Resource.pm @@ -0,0 +1,117 @@ +use utf8; +package App::Yath::Schema::Percona::Resource; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Resource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resources"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "resource_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "resource_type_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "host_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "stamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 0, + }, + "resource_ord", + { data_type => "integer", is_nullable => 0 }, + "data", + { data_type => "json", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("resource_id"); +__PACKAGE__->add_unique_constraint("run_id", ["run_id", "resource_ord"]); +__PACKAGE__->belongs_to( + "host", + "App::Yath::Schema::Result::Host", + { host_id => "host_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "resource_type", + "App::Yath::Schema::Result::ResourceType", + { resource_type_id => "resource_type_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('event_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Resource - Autogenerated result class for Resource in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/ResourceType.pm b/lib/App/Yath/Schema/Percona/ResourceType.pm new file mode 100644 index 000000000..8914c3af6 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/ResourceType.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::Percona::ResourceType; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ResourceType; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resource_types"); +__PACKAGE__->add_columns( + "resource_type_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("resource_type_id"); +__PACKAGE__->add_unique_constraint("name", ["name"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.resource_type_id" => "self.resource_type_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::ResourceType - Autogenerated result class for ResourceType in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Run.pm b/lib/App/Yath/Schema/Percona/Run.pm new file mode 100644 index 000000000..d7c133deb --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Run.pm @@ -0,0 +1,207 @@ +use utf8; +package App::Yath::Schema::Percona::Run; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Run; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("runs"); +__PACKAGE__->add_columns( + "run_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "run_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "project_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "log_file_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "sync_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "passed", + { data_type => "integer", is_nullable => 1 }, + "failed", + { data_type => "integer", is_nullable => 1 }, + "to_retry", + { data_type => "integer", is_nullable => 1 }, + "retried", + { data_type => "integer", is_nullable => 1 }, + "concurrency_j", + { data_type => "integer", is_nullable => 1 }, + "concurrency_x", + { data_type => "integer", is_nullable => 1 }, + "added", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, + "status", + { + data_type => "enum", + default_value => "pending", + extra => { + list => ["pending", "running", "complete", "broken", "canceled"], + }, + is_nullable => 0, + }, + "mode", + { + data_type => "enum", + default_value => "qvfd", + extra => { list => ["qvfds", "qvfd", "qvf", "summary", "complete"] }, + is_nullable => 0, + }, + "canon", + { data_type => "tinyint", is_nullable => 0 }, + "pinned", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "has_coverage", + { data_type => "tinyint", is_nullable => 1 }, + "has_resources", + { data_type => "tinyint", is_nullable => 1 }, + "parameters", + { data_type => "json", is_nullable => 1 }, + "worker_id", + { data_type => "text", is_nullable => 1 }, + "error", + { data_type => "text", is_nullable => 1 }, + "duration", + { data_type => "decimal", is_nullable => 1, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("run_id"); +__PACKAGE__->add_unique_constraint("run_uuid", ["run_uuid"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "log_file", + "App::Yath::Schema::Result::LogFile", + { log_file_id => "log_file_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "run_fields", + "App::Yath::Schema::Result::RunField", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "sweeps", + "App::Yath::Schema::Result::Sweep", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "sync", + "App::Yath::Schema::Result::Sync", + { sync_id => "sync_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "RESTRICT", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('run_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Run - Autogenerated result class for Run in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/RunField.pm b/lib/App/Yath/Schema/Percona/RunField.pm new file mode 100644 index 000000000..d33ab410e --- /dev/null +++ b/lib/App/Yath/Schema/Percona/RunField.pm @@ -0,0 +1,95 @@ +use utf8; +package App::Yath::Schema::Percona::RunField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::RunField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("run_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "run_field_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "json", is_nullable => 1 }, + "details", + { data_type => "text", is_nullable => 1 }, + "raw", + { data_type => "text", is_nullable => 1 }, + "link", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("run_field_id"); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('event_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::RunField - Autogenerated result class for RunField in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Session.pm b/lib/App/Yath/Schema/Percona/Session.pm new file mode 100644 index 000000000..4e5c44293 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Session.pm @@ -0,0 +1,86 @@ +use utf8; +package App::Yath::Schema::Percona::Session; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Session; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sessions"); +__PACKAGE__->add_columns( + "session_uuid", + { data_type => "binary", is_nullable => 0, size => 16 }, + "session_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "active", + { data_type => "tinyint", default_value => 1, is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("session_id"); +__PACKAGE__->add_unique_constraint("session_uuid", ["session_uuid"]); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.session_id" => "self.session_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +__PACKAGE__->inflate_column('session_uuid' => { inflate => \&App::Yath::Schema::Util::format_uuid_for_app, deflate => \&App::Yath::Schema::Util::format_uuid_for_db }); +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Session - Autogenerated result class for Session in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/SessionHost.pm b/lib/App/Yath/Schema/Percona/SessionHost.pm new file mode 100644 index 000000000..92332a432 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/SessionHost.pm @@ -0,0 +1,114 @@ +use utf8; +package App::Yath::Schema::Percona::SessionHost; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SessionHost; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("session_hosts"); +__PACKAGE__->add_columns( + "session_host_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "session_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, + "created", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, + "accessed", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, + "address", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "agent", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("session_host_id"); +__PACKAGE__->add_unique_constraint("address", ["address", "agent", "session_id"]); +__PACKAGE__->belongs_to( + "session", + "App::Yath::Schema::Result::Session", + { session_id => "session_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "RESTRICT", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::SessionHost - Autogenerated result class for SessionHost in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/SourceFile.pm b/lib/App/Yath/Schema/Percona/SourceFile.pm new file mode 100644 index 000000000..92b67a9d9 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/SourceFile.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::Percona::SourceFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_files"); +__PACKAGE__->add_columns( + "source_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_file_id"); +__PACKAGE__->add_unique_constraint("filename", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_file_id" => "self.source_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::SourceFile - Autogenerated result class for SourceFile in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/SourceSub.pm b/lib/App/Yath/Schema/Percona/SourceSub.pm new file mode 100644 index 000000000..3c60934e0 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/SourceSub.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::Percona::SourceSub; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceSub; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_subs"); +__PACKAGE__->add_columns( + "source_sub_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "subname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_sub_id"); +__PACKAGE__->add_unique_constraint("subname", ["subname"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_sub_id" => "self.source_sub_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::SourceSub - Autogenerated result class for SourceSub in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Sweep.pm b/lib/App/Yath/Schema/Percona/Sweep.pm new file mode 100644 index 000000000..b7c6722f4 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Sweep.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::Percona::Sweep; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sweep; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sweeps"); +__PACKAGE__->add_columns( + "sweep_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sweep_id"); +__PACKAGE__->add_unique_constraint("run_id", ["run_id", "name"]); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Sweep - Autogenerated result class for Sweep in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Sync.pm b/lib/App/Yath/Schema/Percona/Sync.pm new file mode 100644 index 000000000..fd7e5c295 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Sync.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::Percona::Sync; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sync; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("syncs"); +__PACKAGE__->add_columns( + "sync_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "last_run_id", + { data_type => "bigint", is_nullable => 0 }, + "last_project_id", + { data_type => "bigint", is_nullable => 0 }, + "last_user_id", + { data_type => "bigint", is_nullable => 0 }, + "source", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sync_id"); +__PACKAGE__->add_unique_constraint("source", ["source"]); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.sync_id" => "self.sync_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Sync - Autogenerated result class for Sync in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/TestFile.pm b/lib/App/Yath/Schema/Percona/TestFile.pm new file mode 100644 index 000000000..4762a0f5e --- /dev/null +++ b/lib/App/Yath/Schema/Percona/TestFile.pm @@ -0,0 +1,95 @@ +use utf8; +package App::Yath::Schema::Percona::TestFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::TestFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("test_files"); +__PACKAGE__->add_columns( + "test_file_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); +__PACKAGE__->set_primary_key("test_file_id"); +__PACKAGE__->add_unique_constraint("filename", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::TestFile - Autogenerated result class for TestFile in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/User.pm b/lib/App/Yath/Schema/Percona/User.pm new file mode 100644 index 000000000..360bfb31e --- /dev/null +++ b/lib/App/Yath/Schema/Percona/User.pm @@ -0,0 +1,138 @@ +use utf8; +package App::Yath::Schema::Percona::User; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::User; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("users"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_auto_increment => 1, is_nullable => 0 }, + "pw_hash", + { data_type => "varchar", is_nullable => 1, size => 31 }, + "pw_salt", + { data_type => "varchar", is_nullable => 1, size => 22 }, + "role", + { + data_type => "enum", + default_value => "user", + extra => { list => ["admin", "user"] }, + is_nullable => 0, + }, + "username", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "realname", + { data_type => "text", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("username", ["username"]); +__PACKAGE__->has_many( + "api_keys", + "App::Yath::Schema::Result::ApiKey", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "emails", + "App::Yath::Schema::Result::Email", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "projects", + "App::Yath::Schema::Result::Project", + { "foreign.owner" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::User - Autogenerated result class for User in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Percona/Version.pm b/lib/App/Yath/Schema/Percona/Version.pm new file mode 100644 index 000000000..7ef5e1020 --- /dev/null +++ b/lib/App/Yath/Schema/Percona/Version.pm @@ -0,0 +1,84 @@ +use utf8; +package App::Yath::Schema::Percona::Version; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Version; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("versions"); +__PACKAGE__->add_columns( + "version", + { data_type => "decimal", is_nullable => 0, size => [10, 6] }, + "version_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "updated", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, +); +__PACKAGE__->set_primary_key("version_id"); +__PACKAGE__->add_unique_constraint("version", ["version"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:35:37 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::Percona::Version - Autogenerated result class for Version in Percona. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/PostgreSQL/ApiKey.pm b/lib/App/Yath/Schema/PostgreSQL/ApiKey.pm index 7fd082bea..00c07ea9e 100644 --- a/lib/App/Yath/Schema/PostgreSQL/ApiKey.pm +++ b/lib/App/Yath/Schema/PostgreSQL/ApiKey.pm @@ -54,7 +54,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Binary.pm b/lib/App/Yath/Schema/PostgreSQL/Binary.pm index 4d7aa62a6..c8bcb5b77 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Binary.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Binary.pm @@ -54,7 +54,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Config.pm b/lib/App/Yath/Schema/PostgreSQL/Config.pm index f4fb2a9e1..98ee73bb0 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Config.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Config.pm @@ -36,7 +36,7 @@ __PACKAGE__->set_primary_key("config_id"); __PACKAGE__->add_unique_constraint("config_setting_key", ["setting"]); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Coverage.pm b/lib/App/Yath/Schema/PostgreSQL/Coverage.pm index 8655066bb..7a5dfb350 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Coverage.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Coverage.pm @@ -103,7 +103,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/CoverageManager.pm b/lib/App/Yath/Schema/PostgreSQL/CoverageManager.pm index 56775491b..18fea43e4 100644 --- a/lib/App/Yath/Schema/PostgreSQL/CoverageManager.pm +++ b/lib/App/Yath/Schema/PostgreSQL/CoverageManager.pm @@ -40,7 +40,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Email.pm b/lib/App/Yath/Schema/PostgreSQL/Email.pm index c87d212e3..cec25e158 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Email.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Email.pm @@ -58,7 +58,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/EmailVerificationCode.pm b/lib/App/Yath/Schema/PostgreSQL/EmailVerificationCode.pm index 036c2609b..cfea4b17e 100644 --- a/lib/App/Yath/Schema/PostgreSQL/EmailVerificationCode.pm +++ b/lib/App/Yath/Schema/PostgreSQL/EmailVerificationCode.pm @@ -34,7 +34,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Event.pm b/lib/App/Yath/Schema/PostgreSQL/Event.pm index f85bf3a3d..be9e7db25 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Event.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Event.pm @@ -59,7 +59,7 @@ __PACKAGE__->add_columns( { data_type => "boolean", is_nullable => 0 }, "has_orphan", { data_type => "boolean", is_nullable => 0 }, - "has_binaries", + "has_binary", { data_type => "boolean", is_nullable => 0 }, "facets", { data_type => "jsonb", is_nullable => 1 }, @@ -122,7 +122,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Host.pm b/lib/App/Yath/Schema/PostgreSQL/Host.pm index d985910ac..981135979 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Host.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Host.pm @@ -40,7 +40,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Job.pm b/lib/App/Yath/Schema/PostgreSQL/Job.pm index 2b8f0b219..2d31d248b 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Job.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Job.pm @@ -62,7 +62,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/JobTry.pm b/lib/App/Yath/Schema/PostgreSQL/JobTry.pm index a7cbdae79..557d13ede 100644 --- a/lib/App/Yath/Schema/PostgreSQL/JobTry.pm +++ b/lib/App/Yath/Schema/PostgreSQL/JobTry.pm @@ -108,7 +108,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/JobTryField.pm b/lib/App/Yath/Schema/PostgreSQL/JobTryField.pm index d29c062ab..74eba3e06 100644 --- a/lib/App/Yath/Schema/PostgreSQL/JobTryField.pm +++ b/lib/App/Yath/Schema/PostgreSQL/JobTryField.pm @@ -51,7 +51,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/LogFile.pm b/lib/App/Yath/Schema/PostgreSQL/LogFile.pm index 6e679aa7c..95dafd5b7 100644 --- a/lib/App/Yath/Schema/PostgreSQL/LogFile.pm +++ b/lib/App/Yath/Schema/PostgreSQL/LogFile.pm @@ -43,7 +43,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Permission.pm b/lib/App/Yath/Schema/PostgreSQL/Permission.pm index 14725cd3a..7223321f0 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Permission.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Permission.pm @@ -58,7 +58,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/PrimaryEmail.pm b/lib/App/Yath/Schema/PostgreSQL/PrimaryEmail.pm index 97432ceae..754764830 100644 --- a/lib/App/Yath/Schema/PostgreSQL/PrimaryEmail.pm +++ b/lib/App/Yath/Schema/PostgreSQL/PrimaryEmail.pm @@ -41,7 +41,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Project.pm b/lib/App/Yath/Schema/PostgreSQL/Project.pm index 7126f086c..72f651293 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Project.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Project.pm @@ -65,7 +65,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Reporting.pm b/lib/App/Yath/Schema/PostgreSQL/Reporting.pm index a6356826b..3a1b041f2 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Reporting.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Reporting.pm @@ -100,7 +100,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Resource.pm b/lib/App/Yath/Schema/PostgreSQL/Resource.pm index 8e4e3a16c..2e4fa799d 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Resource.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Resource.pm @@ -34,7 +34,7 @@ __PACKAGE__->add_columns( "run_id", { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, "host_id", - { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + { data_type => "bigint", is_foreign_key => 1, is_nullable => 1 }, "stamp", { data_type => "timestamp", is_nullable => 0 }, "resource_ord", @@ -51,7 +51,12 @@ __PACKAGE__->belongs_to( "host", "App::Yath::Schema::Result::Host", { host_id => "host_id" }, - { is_deferrable => 0, on_delete => "SET NULL", on_update => "NO ACTION" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, ); __PACKAGE__->belongs_to( "resource_type", @@ -67,7 +72,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/ResourceType.pm b/lib/App/Yath/Schema/PostgreSQL/ResourceType.pm index 88b101f57..ccd687bb1 100644 --- a/lib/App/Yath/Schema/PostgreSQL/ResourceType.pm +++ b/lib/App/Yath/Schema/PostgreSQL/ResourceType.pm @@ -40,7 +40,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Run.pm b/lib/App/Yath/Schema/PostgreSQL/Run.pm index 55d80bfca..bc9ce9f04 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Run.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Run.pm @@ -172,7 +172,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/RunField.pm b/lib/App/Yath/Schema/PostgreSQL/RunField.pm index 064c64377..5abe4260f 100644 --- a/lib/App/Yath/Schema/PostgreSQL/RunField.pm +++ b/lib/App/Yath/Schema/PostgreSQL/RunField.pm @@ -51,7 +51,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Session.pm b/lib/App/Yath/Schema/PostgreSQL/Session.pm index 3a9642698..227f9f3a8 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Session.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Session.pm @@ -42,7 +42,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/SessionHost.pm b/lib/App/Yath/Schema/PostgreSQL/SessionHost.pm index dca57e83d..52b3cd890 100644 --- a/lib/App/Yath/Schema/PostgreSQL/SessionHost.pm +++ b/lib/App/Yath/Schema/PostgreSQL/SessionHost.pm @@ -74,7 +74,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/SourceFile.pm b/lib/App/Yath/Schema/PostgreSQL/SourceFile.pm index 7cf037e6c..0959737bf 100644 --- a/lib/App/Yath/Schema/PostgreSQL/SourceFile.pm +++ b/lib/App/Yath/Schema/PostgreSQL/SourceFile.pm @@ -40,7 +40,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/SourceSub.pm b/lib/App/Yath/Schema/PostgreSQL/SourceSub.pm index 4f0389ece..e8d9886b2 100644 --- a/lib/App/Yath/Schema/PostgreSQL/SourceSub.pm +++ b/lib/App/Yath/Schema/PostgreSQL/SourceSub.pm @@ -40,7 +40,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Sweep.pm b/lib/App/Yath/Schema/PostgreSQL/Sweep.pm index 1afee8a49..bfcf0d785 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Sweep.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Sweep.pm @@ -42,7 +42,7 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Sync.pm b/lib/App/Yath/Schema/PostgreSQL/Sync.pm index 0b251a30c..b2c91a6a0 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Sync.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Sync.pm @@ -46,7 +46,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/TestFile.pm b/lib/App/Yath/Schema/PostgreSQL/TestFile.pm index 4e8c80acd..ec5e85251 100644 --- a/lib/App/Yath/Schema/PostgreSQL/TestFile.pm +++ b/lib/App/Yath/Schema/PostgreSQL/TestFile.pm @@ -52,7 +52,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/User.pm b/lib/App/Yath/Schema/PostgreSQL/User.pm index 846afa526..67db58e75 100644 --- a/lib/App/Yath/Schema/PostgreSQL/User.pm +++ b/lib/App/Yath/Schema/PostgreSQL/User.pm @@ -105,7 +105,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/PostgreSQL/Version.pm b/lib/App/Yath/Schema/PostgreSQL/Version.pm index 22db3a03c..889a6b648 100644 --- a/lib/App/Yath/Schema/PostgreSQL/Version.pm +++ b/lib/App/Yath/Schema/PostgreSQL/Version.pm @@ -41,7 +41,7 @@ __PACKAGE__->set_primary_key("version_id"); __PACKAGE__->add_unique_constraint("versions_version_key", ["version"]); -# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-05-29 14:47:42 +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:18 # DO NOT MODIFY ANY PART OF THIS FILE 1; diff --git a/lib/App/Yath/Schema/ResultSet.pm b/lib/App/Yath/Schema/ResultSet.pm index 7ed853d21..39144fc31 100644 --- a/lib/App/Yath/Schema/ResultSet.pm +++ b/lib/App/Yath/Schema/ResultSet.pm @@ -8,6 +8,7 @@ use parent 'DBIx::Class::ResultSet'; use Carp qw/croak/; use Test2::Util::UUID qw/looks_like_uuid/; +use App::Yath::Schema::Util qw/format_uuid_for_db/; __PACKAGE__->load_components('Helper::ResultSet::RemoveColumns'); @@ -34,10 +35,10 @@ sub find_by_id_or_uuid { } if (looks_like_uuid($id)) { - $query->{$ucol} = $id; + $query->{$ucol} = format_uuid_for_db($id); } elsif ($id =~ m/^\d+$/) { - $query->{$pcol} = $id; + $query->{$pcol} = $id; } else { croak "'$id' does not look like either a numeric ID or a UUID"; diff --git a/lib/App/Yath/Schema/RunProcessor.pm b/lib/App/Yath/Schema/RunProcessor.pm index 4bebae72d..5f2429d1d 100644 --- a/lib/App/Yath/Schema/RunProcessor.pm +++ b/lib/App/Yath/Schema/RunProcessor.pm @@ -20,7 +20,7 @@ use Test2::Util::Facets2Legacy qw/causes_fail/; use App::Yath::Schema::Config; -use App::Yath::Schema::Util qw/format_duration is_invalid_subtest_name schema_config_from_settings/; +use App::Yath::Schema::Util qw/format_duration is_invalid_subtest_name schema_config_from_settings format_uuid_for_db/; use Test2::Util::UUID qw/gen_uuid/; use Test2::Harness::Util::JSON qw/encode_ascii_json decode_json/; @@ -92,7 +92,7 @@ sub init { my $schema = $self->schema; my $run = $schema->resultset('Run')->create({ - run_uuid => $run_uuid, + run_uuid => format_uuid_for_db($run_uuid), user_id => $self->user_id, project_id => $self->project_id, mode => $mode, @@ -198,13 +198,13 @@ sub _process_first_line { my $p = $config->schema->resultset('Project')->find_or_create({name => $proj}); my $u = $config->schema->resultset('User')->find_or_create({username => $user, role => 'user'}); - if (my $old = $config->schema->resultset('Run')->find({run_uuid => $run_uuid})) { + if (my $old = $config->schema->resultset('Run')->find({run_uuid => format_uuid_for_db($run_uuid)})) { die "Run with uuid '$run_uuid' is already published. Use --publish-force to override it." unless $settings->publish->force; $old->delete; } $run = $config->schema->resultset('Run')->create({ - run_uuid => $run_uuid, + run_uuid => format_uuid_for_db($run_uuid), canon => 1, mode => $pub->mode, status => 'pending', @@ -498,7 +498,7 @@ sub get_job { $self->retry_on_disconnect( "vivify job" => sub { $result = $self->schema->resultset('Job')->update_or_create({ - job_uuid => $job_uuid, + job_uuid => format_uuid_for_db($job_uuid), run_id => $run_id, test_file_id => $test_file_id, is_harness_out => $is_harness_out, @@ -660,7 +660,7 @@ sub _pull_facet_binaries { $file->{data} = 'Extracted to the "binaries" table'; push @binaries => { - event_uuid => $e_uuid, + event_uuid => format_uuid_for_db($e_uuid), filename => $file->{filename}, description => $file->{details}, data => decode_base64($data), @@ -694,7 +694,7 @@ sub _pull_facet_resource { host_id => $host_id, resource_type_id => $resource_type_id, resource_ord => $ord, - event_uuid => $e_uuid, + event_uuid => format_uuid_for_db($e_uuid), data => encode_ascii_json($data), stamp => $stamp, }; @@ -744,7 +744,7 @@ sub _pre_process_coverage { return { run_id => $self->{+RUN_ID}, - event_uuid => $e_uuid, + event_uuid => format_uuid_for_db($e_uuid), test_file_id => $test_id, source_file_id => $source_id, source_sub_id => $sub_id, @@ -849,7 +849,7 @@ sub _pull_facet__fields { my $row = { %mixin, - event_uuid => $e_uuid, + event_uuid => format_uuid_for_db($e_uuid), name => $name, details => $field->{details} || $name, }; @@ -1238,8 +1238,8 @@ sub _process_event { job_try_id => $try->{job_try_id}, - event_uuid => $e_uuid, - trace_uuid => $trace->{uuid}, + event_uuid => format_uuid_for_db($e_uuid), + trace_uuid => $trace->{uuid} ? format_uuid_for_db($trace->{uuid}) : undef, stamp => $formatted_stamp, event_idx => $idx, @@ -1253,12 +1253,12 @@ sub _process_event { causes_fail => $fail, - $params{parent} ? (parent_uuid => $params{parent}) : (), + $params{parent} ? (parent_uuid => format_uuid_for_db($params{parent})) : (), # Facet version wins if we have one, but we want them here if all we # got was an orphan. - $binaries ? (has_binaries => 1, rel_binaries => $binaries) : (has_binaries => 0), + $binaries ? (has_binary => 1, rel_binaries => $binaries) : (has_binary => 0), $rendered ? (rendered => $rendered) : (), ); @@ -1438,11 +1438,12 @@ sub flush_try { if ($self->{+DONE} || $try->{done}) { $delta //= {}; my $res = $try->{result}; - my $status = $res->status || ''; + my $status = $delta->{'=status'} || $res->status || ''; unless ($status eq 'complete') { my $status = $self->{+SIGNAL} ? 'canceled' : 'broken'; $status = 'canceled' if $self->{+DONE} && !$try->{done}; + $status = 'complete' if $try->{job}->{is_harness_out}; $delta->{'=status'} = $status; } @@ -1588,10 +1589,14 @@ sub flush_events { if (@write_events) { @write_events = sort { $a->{event_idx} <=> $b->{event_idx} || $a->{event_sdx} <=> $b->{event_sdx} } @write_events; - $self->populate(Event => \@write_events) + $self->populate(Event => \@write_events); + $self->fix_event_tree($try) if $parent_ids; } - $self->populate(Binary => \@write_bin) if @write_bin; + if (@write_bin) { + $self->populate(Binary => \@write_bin); + $self->fix_binary_events($try); + } } if ($done && !$try->{normalized}) { @@ -1599,7 +1604,6 @@ sub flush_events { $try->{result}->normalize_to_mode(mode => $self->{+MODE}); $try->{normalized} = 1; - $self->fix_event_tree($try) if $parent_ids; $self->remove_orphans($try) unless $try->{result}->fail; } @@ -1610,27 +1614,75 @@ sub fix_event_tree { my $self = shift; my ($try) = @_; - # FIXME: Need different mysql syntax, also test sqlite + my $dbh = $self->{+CONFIG}->connect; - my $sth = $dbh->prepare(<<" EOT"); - UPDATE events - SET parent_id = event2.event_id - FROM events AS event2 - WHERE events.job_try_id = ? - AND events.job_try_id = event2.job_try_id - AND events.parent_id IS NULL - AND events.parent_uuid = event2.event_uuid - EOT + my $schema = $self->{+CONFIG}->schema; + my $sth; + + if ($schema->is_postgresql || $schema->is_sqlite) { + $sth = $dbh->prepare(<<" EOT"); + UPDATE events + SET parent_id = event2.event_id + FROM events AS event2 + WHERE events.job_try_id = ? + AND events.job_try_id = event2.job_try_id + AND events.parent_id IS NULL + AND events.parent_uuid = event2.event_uuid + EOT + } + elsif ($schema->is_mysql) { + $sth = $dbh->prepare(<<" EOT"); + UPDATE events event1 + JOIN events AS event2 ON event1.parent_uuid = event2.event_uuid + SET event1.parent_id = event2.event_id + WHERE event1.job_try_id = ? + AND event1.job_try_id = event2.job_try_id + AND event1.parent_id IS NULL + EOT + } $sth->execute($try->{job_try_id}) or die $sth->errstr; } +sub fix_binary_events { + my $self = shift; + my ($try) = @_; + + my $dbh = $self->{+CONFIG}->connect; + my $schema = $self->{+CONFIG}->schema; + my $sth; + + if ($schema->is_postgresql || $schema->is_sqlite) { + $sth = $dbh->prepare(<<" EOT"); + UPDATE binaries + SET event_id = events.event_id + FROM events + WHERE events.job_try_id = ? + AND events.event_uuid = binaries.event_uuid + EOT + } + elsif ($schema->is_mysql) { + $sth = $dbh->prepare(<<" EOT"); + UPDATE binaries + JOIN events ON events.event_uuid = binaries.event_uuid + SET binaries.event_id = events.event_id + WHERE events.job_try_id = ? + AND events.event_uuid = binaries.event_uuid + AND binaries.event_id IS NULL + EOT + } + + $sth->execute($try->{job_try_id}) or die $sth->errstr; +} + + sub remove_orphans { my $self = shift; my ($try) = @_; - # FIXME: Need different mysql syntax, also test sqlite my $dbh = $self->{+CONFIG}->connect; + my $schema = $self->{+CONFIG}->schema; + my $sth = $dbh->prepare(<<" EOT"); UPDATE events SET orphan = NULL diff --git a/lib/App/Yath/Schema/SQLite/ApiKey.pm b/lib/App/Yath/Schema/SQLite/ApiKey.pm new file mode 100644 index 000000000..4edfedbd0 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/ApiKey.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::SQLite::ApiKey; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ApiKey; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("api_keys"); +__PACKAGE__->add_columns( + "api_key_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "value", + { data_type => "uuid", is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "status", + { data_type => "text", is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("api_key_id"); +__PACKAGE__->add_unique_constraint("value_unique", ["value"]); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::ApiKey - Autogenerated result class for ApiKey in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Binary.pm b/lib/App/Yath/Schema/SQLite/Binary.pm new file mode 100644 index 000000000..a78edfc7c --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Binary.pm @@ -0,0 +1,102 @@ +use utf8; +package App::Yath::Schema::SQLite::Binary; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Binary; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("binaries"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "binary_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "event_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "is_image", + { data_type => "bool", default_value => \"FALSE", is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, + "description", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("binary_id"); +__PACKAGE__->belongs_to( + "event", + "App::Yath::Schema::Result::Event", + { event_id => "event_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "NO ACTION", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Binary - Autogenerated result class for Binary in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Config.pm b/lib/App/Yath/Schema/SQLite/Config.pm new file mode 100644 index 000000000..3aec46c1d --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Config.pm @@ -0,0 +1,79 @@ +use utf8; +package App::Yath::Schema::SQLite::Config; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Config; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("config"); +__PACKAGE__->add_columns( + "config_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "setting", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "value", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("config_id"); +__PACKAGE__->add_unique_constraint("setting_unique", ["setting"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Config - Autogenerated result class for Config in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Coverage.pm b/lib/App/Yath/Schema/SQLite/Coverage.pm new file mode 100644 index 000000000..095d97710 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Coverage.pm @@ -0,0 +1,156 @@ +use utf8; +package App::Yath::Schema::SQLite::Coverage; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Coverage; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "coverage_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "coverage_manager_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "run_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "source_file_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "source_sub_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "metadata", + { data_type => "json", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("coverage_id"); +__PACKAGE__->add_unique_constraint( + "run_id_job_try_id_test_file_id_source_file_id_source_sub_id_unique", + [ + "run_id", + "job_try_id", + "test_file_id", + "source_file_id", + "source_sub_id", + ], +); +__PACKAGE__->belongs_to( + "coverage_manager", + "App::Yath::Schema::Result::CoverageManager", + { coverage_manager_id => "coverage_manager_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "source_file", + "App::Yath::Schema::Result::SourceFile", + { source_file_id => "source_file_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "source_sub", + "App::Yath::Schema::Result::SourceSub", + { source_sub_id => "source_sub_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Coverage - Autogenerated result class for Coverage in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/CoverageManager.pm b/lib/App/Yath/Schema/SQLite/CoverageManager.pm new file mode 100644 index 000000000..62588bc16 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/CoverageManager.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::SQLite::CoverageManager; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::CoverageManager; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("coverage_manager"); +__PACKAGE__->add_columns( + "coverage_manager_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "package", + { data_type => "varchar", is_nullable => 0, size => 256 }, +); +__PACKAGE__->set_primary_key("coverage_manager_id"); +__PACKAGE__->add_unique_constraint("package_unique", ["package"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.coverage_manager_id" => "self.coverage_manager_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::CoverageManager - Autogenerated result class for CoverageManager in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Email.pm b/lib/App/Yath/Schema/SQLite/Email.pm new file mode 100644 index 000000000..b5a9e31fb --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Email.pm @@ -0,0 +1,101 @@ +use utf8; +package App::Yath::Schema::SQLite::Email; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Email; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email"); +__PACKAGE__->add_columns( + "email_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "verified", + { data_type => "bool", default_value => \"FALSE", is_nullable => 0 }, + "local", + { data_type => "varchar", is_nullable => 0, size => 128 }, + "domain", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->add_unique_constraint("local_domain_unique", ["local", "domain"]); +__PACKAGE__->might_have( + "email_verification_code", + "App::Yath::Schema::Result::EmailVerificationCode", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.email_id" => "self.email_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Email - Autogenerated result class for Email in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/EmailVerificationCode.pm b/lib/App/Yath/Schema/SQLite/EmailVerificationCode.pm new file mode 100644 index 000000000..cf273a121 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/EmailVerificationCode.pm @@ -0,0 +1,82 @@ +use utf8; +package App::Yath::Schema::SQLite::EmailVerificationCode; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::EmailVerificationCode; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("email_verification_codes"); +__PACKAGE__->add_columns( + "evcode", + { data_type => "uuid", is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("email_id"); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::EmailVerificationCode - Autogenerated result class for EmailVerificationCode in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Event.pm b/lib/App/Yath/Schema/SQLite/Event.pm new file mode 100644 index 000000000..6e079b559 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Event.pm @@ -0,0 +1,175 @@ +use utf8; +package App::Yath::Schema::SQLite::Event; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Event; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("events"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "trace_uuid", + { data_type => "uuid", default_value => \"null", is_nullable => 1 }, + "parent_uuid", + { + data_type => "uuid", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "event_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "parent_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "event_idx", + { data_type => "integer", is_nullable => 0 }, + "event_sdx", + { data_type => "integer", is_nullable => 0 }, + "stamp", + { data_type => "timestamp", default_value => \"null", is_nullable => 1 }, + "nested", + { data_type => "smallintegernot", is_nullable => 1 }, + "is_subtest", + { data_type => "bool", is_nullable => 0 }, + "is_diag", + { data_type => "bool", is_nullable => 0 }, + "is_harness", + { data_type => "bool", is_nullable => 0 }, + "is_time", + { data_type => "bool", is_nullable => 0 }, + "causes_fail", + { data_type => "bool", is_nullable => 0 }, + "has_facets", + { data_type => "bool", is_nullable => 0 }, + "has_orphan", + { data_type => "bool", is_nullable => 0 }, + "has_binary", + { data_type => "bool", is_nullable => 0 }, + "facets", + { data_type => "json", default_value => \"null", is_nullable => 1 }, + "orphan", + { data_type => "json", default_value => \"null", is_nullable => 1 }, + "rendered", + { data_type => "json", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("event_id"); +__PACKAGE__->add_unique_constraint("event_uuid_unique", ["event_uuid"]); +__PACKAGE__->add_unique_constraint( + "job_try_id_event_idx_event_sdx_unique", + ["job_try_id", "event_idx", "event_sdx"], +); +__PACKAGE__->has_many( + "binaries", + "App::Yath::Schema::Result::Binary", + { "foreign.event_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parent_uuids", + "App::Yath::Schema::Result::Event", + { "foreign.parent_uuid" => "self.event_uuid" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events_parents", + "App::Yath::Schema::Result::Event", + { "foreign.parent_id" => "self.event_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "parent", + "App::Yath::Schema::Result::Event", + { event_id => "parent_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "parent_uuid", + "App::Yath::Schema::Result::Event", + { event_uuid => "parent_uuid" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "NO ACTION", + on_update => "NO ACTION", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Event - Autogenerated result class for Event in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Host.pm b/lib/App/Yath/Schema/SQLite/Host.pm new file mode 100644 index 000000000..ec1106cb6 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Host.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::SQLite::Host; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Host; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("hosts"); +__PACKAGE__->add_columns( + "host_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "hostname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("host_id"); +__PACKAGE__->add_unique_constraint("hostname_unique", ["hostname"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.host_id" => "self.host_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Host - Autogenerated result class for Host in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Job.pm b/lib/App/Yath/Schema/SQLite/Job.pm new file mode 100644 index 000000000..d5c59705a --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Job.pm @@ -0,0 +1,105 @@ +use utf8; +package App::Yath::Schema::SQLite::Job; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Job; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("jobs"); +__PACKAGE__->add_columns( + "job_uuid", + { data_type => "uuid", is_nullable => 0 }, + "job_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "test_file_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "is_harness_out", + { data_type => "bool", is_nullable => 0 }, + "failed", + { data_type => "bool", is_nullable => 0 }, + "passed", + { data_type => "bool", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_id"); +__PACKAGE__->add_unique_constraint("job_uuid_unique", ["job_uuid"]); +__PACKAGE__->has_many( + "jobs_tries", + "App::Yath::Schema::Result::JobTry", + { "foreign.job_id" => "self.job_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Job - Autogenerated result class for Job in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/JobTry.pm b/lib/App/Yath/Schema/SQLite/JobTry.pm new file mode 100644 index 000000000..6a4da738d --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/JobTry.pm @@ -0,0 +1,143 @@ +use utf8; +package App::Yath::Schema::SQLite::JobTry; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTry; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_tries"); +__PACKAGE__->add_columns( + "job_try_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "job_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "pass_count", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "fail_count", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "exit_code", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "launch", + { data_type => "timestamp", default_value => \"null", is_nullable => 1 }, + "start", + { data_type => "timestamp", default_value => \"null", is_nullable => 1 }, + "ended", + { data_type => "timestamp", default_value => \"null", is_nullable => 1 }, + "status", + { data_type => "text", default_value => "pending", is_nullable => 0 }, + "job_try_ord", + { data_type => "smallinteger", is_nullable => 0 }, + "fail", + { data_type => "bool", default_value => \"null", is_nullable => 1 }, + "retry", + { data_type => "bool", default_value => \"null", is_nullable => 1 }, + "duration", + { + data_type => "numeric", + default_value => \"null", + is_nullable => 1, + size => [14, 4], + }, + "parameters", + { data_type => "json", default_value => \"null", is_nullable => 1 }, + "stdout", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "stderr", + { data_type => "text", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_try_id"); +__PACKAGE__->add_unique_constraint( + "job_try_id_job_try_ord_unique", + ["job_try_id", "job_try_ord"], +); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "events", + "App::Yath::Schema::Result::Event", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "job", + "App::Yath::Schema::Result::Job", + { job_id => "job_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->has_many( + "job_try_fields", + "App::Yath::Schema::Result::JobTryField", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.job_try_id" => "self.job_try_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::JobTry - Autogenerated result class for JobTry in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/JobTryField.pm b/lib/App/Yath/Schema/SQLite/JobTryField.pm new file mode 100644 index 000000000..6237f7d05 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/JobTryField.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::SQLite::JobTryField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::JobTryField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("job_try_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "job_field_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "json", default_value => \"null", is_nullable => 1 }, + "details", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "raw", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "link", + { data_type => "text", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("job_field_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::JobTryField - Autogenerated result class for JobTryField in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/LogFile.pm b/lib/App/Yath/Schema/SQLite/LogFile.pm new file mode 100644 index 000000000..ff63a0486 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/LogFile.pm @@ -0,0 +1,86 @@ +use utf8; +package App::Yath::Schema::SQLite::LogFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::LogFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("log_files"); +__PACKAGE__->add_columns( + "log_file_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "text", is_nullable => 0 }, + "local_file", + { data_type => "text", is_nullable => 1 }, + "data", + { data_type => "longblob", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("log_file_id"); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.log_file_id" => "self.log_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::LogFile - Autogenerated result class for LogFile in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Permission.pm b/lib/App/Yath/Schema/SQLite/Permission.pm new file mode 100644 index 000000000..4d1a1bdfa --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Permission.pm @@ -0,0 +1,93 @@ +use utf8; +package App::Yath::Schema::SQLite::Permission; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Permission; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("permissions"); +__PACKAGE__->add_columns( + "permission_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "project_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "updated", + { data_type => "timestamp", default_value => \"now", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("permission_id"); +__PACKAGE__->add_unique_constraint("project_id_user_id_unique", ["project_id", "user_id"]); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Permission - Autogenerated result class for Permission in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/PrimaryEmail.pm b/lib/App/Yath/Schema/SQLite/PrimaryEmail.pm new file mode 100644 index 000000000..ab43c3b75 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/PrimaryEmail.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::SQLite::PrimaryEmail; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::PrimaryEmail; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("primary_email"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, + "email_id", + { data_type => "bigint", is_foreign_key => 1, is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("email_id_unique", ["email_id"]); +__PACKAGE__->belongs_to( + "email", + "App::Yath::Schema::Result::Email", + { email_id => "email_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::PrimaryEmail - Autogenerated result class for PrimaryEmail in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Project.pm b/lib/App/Yath/Schema/SQLite/Project.pm new file mode 100644 index 000000000..065e30bb7 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Project.pm @@ -0,0 +1,113 @@ +use utf8; +package App::Yath::Schema::SQLite::Project; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Project; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("projects"); +__PACKAGE__->add_columns( + "project_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "owner", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "name", + { data_type => "varchar", is_nullable => 0, size => 128 }, +); +__PACKAGE__->set_primary_key("project_id"); +__PACKAGE__->add_unique_constraint("name_unique", ["name"]); +__PACKAGE__->belongs_to( + "owner", + "App::Yath::Schema::Result::User", + { user_id => "owner" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.project_id" => "self.project_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Project - Autogenerated result class for Project in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Reporting.pm b/lib/App/Yath/Schema/SQLite/Reporting.pm new file mode 100644 index 000000000..92ef21070 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Reporting.pm @@ -0,0 +1,153 @@ +use utf8; +package App::Yath::Schema::SQLite::Reporting; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Reporting; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("reporting"); +__PACKAGE__->add_columns( + "reporting_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "job_try_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "test_file_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "project_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "job_try", + { data_type => "smallinteger", default_value => \"null", is_nullable => 1 }, + "retry", + { data_type => "smallinteger", is_nullable => 0 }, + "abort", + { data_type => "smallinteger", is_nullable => 0 }, + "fail", + { data_type => "smallinteger", is_nullable => 0 }, + "pass", + { data_type => "smallinteger", is_nullable => 0 }, + "subtest", + { + data_type => "varchar", + default_value => \"null", + is_nullable => 1, + size => 512, + }, + "duration", + { data_type => "numeric", is_nullable => 0, size => [14, 4] }, +); +__PACKAGE__->set_primary_key("reporting_id"); +__PACKAGE__->belongs_to( + "job_try", + "App::Yath::Schema::Result::JobTry", + { job_try_id => "job_try_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "test_file", + "App::Yath::Schema::Result::TestFile", + { test_file_id => "test_file_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Reporting - Autogenerated result class for Reporting in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Resource.pm b/lib/App/Yath/Schema/SQLite/Resource.pm new file mode 100644 index 000000000..0d1aff7b3 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Resource.pm @@ -0,0 +1,112 @@ +use utf8; +package App::Yath::Schema::SQLite::Resource; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Resource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resources"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "resource_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "resource_type_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "run_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "host_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "stamp", + { data_type => "timestamp", is_nullable => 0 }, + "resource_ord", + { data_type => "integer", is_nullable => 0 }, + "data", + { data_type => "json", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("resource_id"); +__PACKAGE__->add_unique_constraint("run_id_resource_ord_unique", ["run_id", "resource_ord"]); +__PACKAGE__->belongs_to( + "host", + "App::Yath::Schema::Result::Host", + { host_id => "host_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "resource_type", + "App::Yath::Schema::Result::ResourceType", + { resource_type_id => "resource_type_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Resource - Autogenerated result class for Resource in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/ResourceType.pm b/lib/App/Yath/Schema/SQLite/ResourceType.pm new file mode 100644 index 000000000..5363d4d78 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/ResourceType.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::SQLite::ResourceType; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::ResourceType; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("resource_types"); +__PACKAGE__->add_columns( + "resource_type_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("resource_type_id"); +__PACKAGE__->add_unique_constraint("name_unique", ["name"]); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.resource_type_id" => "self.resource_type_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::ResourceType - Autogenerated result class for ResourceType in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Run.pm b/lib/App/Yath/Schema/SQLite/Run.pm new file mode 100644 index 000000000..ad86a28c2 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Run.pm @@ -0,0 +1,204 @@ +use utf8; +package App::Yath::Schema::SQLite::Run; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Run; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("runs"); +__PACKAGE__->add_columns( + "run_uuid", + { data_type => "uuid", is_nullable => 0 }, + "run_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "project_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "log_file_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "sync_id", + { + data_type => "integer", + default_value => \"null", + is_foreign_key => 1, + is_nullable => 1, + }, + "passed", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "failed", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "to_retry", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "retried", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "concurrency_j", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "concurrency_x", + { data_type => "integer", default_value => \"null", is_nullable => 1 }, + "added", + { data_type => "timestamp", default_value => \"now", is_nullable => 0 }, + "status", + { data_type => "text", default_value => "pending", is_nullable => 0 }, + "mode", + { data_type => "text", default_value => "qvfd", is_nullable => 0 }, + "canon", + { data_type => "bool", is_nullable => 0 }, + "pinned", + { data_type => "bool", default_value => \"FALSE", is_nullable => 0 }, + "has_coverage", + { data_type => "bool", default_value => \"null", is_nullable => 1 }, + "has_resources", + { data_type => "bool", default_value => \"null", is_nullable => 1 }, + "parameters", + { data_type => "json", default_value => \"null", is_nullable => 1 }, + "worker_id", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "error", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "duration", + { + data_type => "numeric", + default_value => \"null", + is_nullable => 1, + size => [14, 4], + }, +); +__PACKAGE__->set_primary_key("run_id"); +__PACKAGE__->add_unique_constraint("run_uuid_unique", ["run_uuid"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "log_file", + "App::Yath::Schema::Result::LogFile", + { log_file_id => "log_file_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "project", + "App::Yath::Schema::Result::Project", + { project_id => "project_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "resources", + "App::Yath::Schema::Result::Resource", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "run_fields", + "App::Yath::Schema::Result::RunField", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "sweeps", + "App::Yath::Schema::Result::Sweep", + { "foreign.run_id" => "self.run_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->belongs_to( + "sync", + "App::Yath::Schema::Result::Sync", + { sync_id => "sync_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "NO ACTION", + }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Run - Autogenerated result class for Run in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/RunField.pm b/lib/App/Yath/Schema/SQLite/RunField.pm new file mode 100644 index 000000000..9db20c3fa --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/RunField.pm @@ -0,0 +1,94 @@ +use utf8; +package App::Yath::Schema::SQLite::RunField; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::RunField; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("run_fields"); +__PACKAGE__->add_columns( + "event_uuid", + { data_type => "uuid", is_nullable => 0 }, + "run_field_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "data", + { data_type => "json", default_value => \"null", is_nullable => 1 }, + "details", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "raw", + { data_type => "text", default_value => \"null", is_nullable => 1 }, + "link", + { data_type => "text", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("run_field_id"); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::RunField - Autogenerated result class for RunField in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Session.pm b/lib/App/Yath/Schema/SQLite/Session.pm new file mode 100644 index 000000000..b00c26f9b --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Session.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::SQLite::Session; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Session; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sessions"); +__PACKAGE__->add_columns( + "session_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "session_uuid", + { data_type => "uuid", is_nullable => 0 }, + "active", + { data_type => "bool", default_value => \"TRUE", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("session_id"); +__PACKAGE__->add_unique_constraint("session_uuid_unique", ["session_uuid"]); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.session_id" => "self.session_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Session - Autogenerated result class for Session in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/SessionHost.pm b/lib/App/Yath/Schema/SQLite/SessionHost.pm new file mode 100644 index 000000000..eec9a3441 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/SessionHost.pm @@ -0,0 +1,107 @@ +use utf8; +package App::Yath::Schema::SQLite::SessionHost; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SessionHost; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("session_hosts"); +__PACKAGE__->add_columns( + "session_host_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "user_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "session_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "created", + { data_type => "timestamp", default_value => \"now", is_nullable => 0 }, + "accessed", + { data_type => "timestamp", default_value => \"now", is_nullable => 0 }, + "address", + { data_type => "text", is_nullable => 0 }, + "agent", + { data_type => "text", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("session_host_id"); +__PACKAGE__->add_unique_constraint( + "address_agent_session_id_unique", + ["address", "agent", "session_id"], +); +__PACKAGE__->belongs_to( + "session", + "App::Yath::Schema::Result::Session", + { session_id => "session_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); +__PACKAGE__->belongs_to( + "user", + "App::Yath::Schema::Result::User", + { user_id => "user_id" }, + { + is_deferrable => 0, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "NO ACTION", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::SessionHost - Autogenerated result class for SessionHost in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/SourceFile.pm b/lib/App/Yath/Schema/SQLite/SourceFile.pm new file mode 100644 index 000000000..60da0d425 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/SourceFile.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::SQLite::SourceFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_files"); +__PACKAGE__->add_columns( + "source_file_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_file_id"); +__PACKAGE__->add_unique_constraint("filename_unique", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_file_id" => "self.source_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::SourceFile - Autogenerated result class for SourceFile in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/SourceSub.pm b/lib/App/Yath/Schema/SQLite/SourceSub.pm new file mode 100644 index 000000000..bb02d7190 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/SourceSub.pm @@ -0,0 +1,83 @@ +use utf8; +package App::Yath::Schema::SQLite::SourceSub; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::SourceSub; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("source_subs"); +__PACKAGE__->add_columns( + "source_sub_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "subname", + { data_type => "varchar", is_nullable => 0, size => 512 }, +); +__PACKAGE__->set_primary_key("source_sub_id"); +__PACKAGE__->add_unique_constraint("subname_unique", ["subname"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.source_sub_id" => "self.source_sub_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::SourceSub - Autogenerated result class for SourceSub in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Sweep.pm b/lib/App/Yath/Schema/SQLite/Sweep.pm new file mode 100644 index 000000000..84206026f --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Sweep.pm @@ -0,0 +1,85 @@ +use utf8; +package App::Yath::Schema::SQLite::Sweep; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sweep; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("sweeps"); +__PACKAGE__->add_columns( + "sweep_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "run_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sweep_id"); +__PACKAGE__->add_unique_constraint("run_id_name_unique", ["run_id", "name"]); +__PACKAGE__->belongs_to( + "run", + "App::Yath::Schema::Result::Run", + { run_id => "run_id" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Sweep - Autogenerated result class for Sweep in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Sync.pm b/lib/App/Yath/Schema/SQLite/Sync.pm new file mode 100644 index 000000000..70b997cbf --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Sync.pm @@ -0,0 +1,89 @@ +use utf8; +package App::Yath::Schema::SQLite::Sync; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Sync; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("syncs"); +__PACKAGE__->add_columns( + "sync_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "last_run_id", + { data_type => "integer", is_nullable => 0 }, + "last_project_id", + { data_type => "integer", is_nullable => 0 }, + "last_user_id", + { data_type => "integer", is_nullable => 0 }, + "source", + { data_type => "varchar", is_nullable => 0, size => 64 }, +); +__PACKAGE__->set_primary_key("sync_id"); +__PACKAGE__->add_unique_constraint("source_unique", ["source"]); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.sync_id" => "self.sync_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Sync - Autogenerated result class for Sync in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/TestFile.pm b/lib/App/Yath/Schema/SQLite/TestFile.pm new file mode 100644 index 000000000..8249707cd --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/TestFile.pm @@ -0,0 +1,95 @@ +use utf8; +package App::Yath::Schema::SQLite::TestFile; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::TestFile; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("test_files"); +__PACKAGE__->add_columns( + "test_file_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "filename", + { data_type => "varchar", is_nullable => 0, size => 255 }, +); +__PACKAGE__->set_primary_key("test_file_id"); +__PACKAGE__->add_unique_constraint("filename_unique", ["filename"]); +__PACKAGE__->has_many( + "coverage", + "App::Yath::Schema::Result::Coverage", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "jobs", + "App::Yath::Schema::Result::Job", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.test_file_id" => "self.test_file_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::TestFile - Autogenerated result class for TestFile in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/User.pm b/lib/App/Yath/Schema/SQLite/User.pm new file mode 100644 index 000000000..71bd9b054 --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/User.pm @@ -0,0 +1,143 @@ +use utf8; +package App::Yath::Schema::SQLite::User; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::User; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("users"); +__PACKAGE__->add_columns( + "user_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "pw_hash", + { + data_type => "varchar", + default_value => \"null", + is_nullable => 1, + size => 31, + }, + "pw_salt", + { + data_type => "varchar", + default_value => \"null", + is_nullable => 1, + size => 22, + }, + "role", + { data_type => "text", default_value => "user", is_nullable => 0 }, + "username", + { data_type => "varchar", is_nullable => 0, size => 64 }, + "realname", + { data_type => "text", default_value => \"null", is_nullable => 1 }, +); +__PACKAGE__->set_primary_key("user_id"); +__PACKAGE__->add_unique_constraint("username_unique", ["username"]); +__PACKAGE__->has_many( + "api_keys", + "App::Yath::Schema::Result::ApiKey", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "emails", + "App::Yath::Schema::Result::Email", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "permissions", + "App::Yath::Schema::Result::Permission", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->might_have( + "primary_email", + "App::Yath::Schema::Result::PrimaryEmail", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "projects", + "App::Yath::Schema::Result::Project", + { "foreign.owner" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "reports", + "App::Yath::Schema::Result::Reporting", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "runs", + "App::Yath::Schema::Result::Run", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); +__PACKAGE__->has_many( + "session_hosts", + "App::Yath::Schema::Result::SessionHost", + { "foreign.user_id" => "self.user_id" }, + { cascade_copy => 0, cascade_delete => 1 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::User - Autogenerated result class for User in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/SQLite/Version.pm b/lib/App/Yath/Schema/SQLite/Version.pm new file mode 100644 index 000000000..e1e2ad50a --- /dev/null +++ b/lib/App/Yath/Schema/SQLite/Version.pm @@ -0,0 +1,79 @@ +use utf8; +package App::Yath::Schema::SQLite::Version; +our $VERSION = '2.000000'; + +package + App::Yath::Schema::Result::Version; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY ANY PART OF THIS FILE + +use strict; +use warnings; + +use parent 'App::Yath::Schema::ResultBase'; +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "InflateColumn::Serializer", + "InflateColumn::Serializer::JSON", + "UUIDColumns", +); +__PACKAGE__->table("versions"); +__PACKAGE__->add_columns( + "version_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "version", + { data_type => "numeric", is_nullable => 0, size => [10, 6] }, + "updated", + { data_type => "timestamp", default_value => \"now", is_nullable => 0 }, +); +__PACKAGE__->set_primary_key("version_id"); +__PACKAGE__->add_unique_constraint("version_unique", ["version"]); + + +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-06-03 19:08:19 +# DO NOT MODIFY ANY PART OF THIS FILE + +1; + +__END__ + +=pod + +=encoding UTF-8 + +=head1 NAME + +App::Yath::Schema::SQLite::Version - Autogenerated result class for Version in SQLite. + +=head1 SOURCE + +The source code repository for Test2-Harness can be found at +L. + +=head1 MAINTAINERS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 AUTHORS + +=over 4 + +=item Chad Granum Eexodist@cpan.orgE + +=back + +=head1 COPYRIGHT + +Copyright Chad Granum Eexodist7@gmail.comE. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +See L + +=cut diff --git a/lib/App/Yath/Schema/Util.pm b/lib/App/Yath/Schema/Util.pm index da776f53d..b9f9753e6 100644 --- a/lib/App/Yath/Schema/Util.pm +++ b/lib/App/Yath/Schema/Util.pm @@ -8,10 +8,26 @@ use Carp qw/croak/; use Test2::Harness::Util qw/mod2file/; - use Importer Importer => 'import'; -our @EXPORT = qw/qdb_driver dbd_driver schema_config_from_settings find_job format_duration parse_duration is_invalid_subtest_name/; +our @EXPORT = qw{ + schema_config_from_settings + + qdb_driver dbd_driver + find_job find_job_and_try + format_duration parse_duration + + is_invalid_subtest_name + + is_mysql + is_postgresql + is_sqlite + is_percona + is_mariadb + + format_uuid_for_db + format_uuid_for_app +}; my %SCHEMA_TO_QDB_DRIVER = ( sqlite => 'SQLite', @@ -116,20 +132,45 @@ sub schema_config_from_settings { return App::Yath::Schema::Config->new(%params); } -sub find_job { +{ + no strict 'refs'; + no warnings 'once'; + *{$_} = *{"App::Yath::Schema::$_"} for qw/is_mysql is_postgresql is_sqlite is_percona is_mariadb/; +} + +sub format_uuid_for_db { App::Yath::Schema->format_uuid_for_db(@_) } +sub format_uuid_for_app { App::Yath::Schema->format_uuid_for_app(@_) } + +sub find_job_and_try { my ($schema, $uuid, $try) = @_; - my $jobs = $schema->resultset('Job'); + my $job = find_job(@_); + my $job_id = $job->job_id; + + my $job_try = find_job_try($schema, $job_id, $try); + + return ($job, $job_try); +} + +sub find_job { + my ($schema, $uuid) = @_; + + return $schema->resultset('Job')->find({job_uuid => format_uuid_for_db($uuid)}); +} + +sub find_job_try { + my ($schema, $job_id, $try) = @_; + + my $job_tries = $schema->resultset('JobTry'); if (length $try) { - return $jobs->search({job_id => $uuid}, {order_by => {'-desc' => 'job_try'}, limit => 1})->first + return $job_tries->search({job_id => $job_id}, {order_by => {'-desc' => 'job_try_ord'}, limit => 1})->first if $try == -1; - return $jobs->search({job_id => $uuid, job_try => $try})->first; + return $job_tries->find({job_id => $job_id, job_try_ord => $try}); } - return $jobs->search({job_key => $uuid})->first - || $jobs->search({job_id => $uuid}, {order_by => {'-desc' => 'job_try'}, limit => 1})->first; + return $job_tries->search({job_id => $job_id}, {order_by => {'-desc' => 'job_try_ord'}, limit => 1})->first; } sub base_name { diff --git a/lib/App/Yath/Server/Controller/Events.pm b/lib/App/Yath/Server/Controller/Events.pm index 49d4db8a9..017993ae2 100644 --- a/lib/App/Yath/Server/Controller/Events.pm +++ b/lib/App/Yath/Server/Controller/Events.pm @@ -30,15 +30,15 @@ sub handle { my (%query, %attrs, $rs, $meth, $event); if ($route->{from} eq 'single_event') { - $event = $schema->resultset('Event')->find({event_id => $it}, {remove_columns => [qw/orphan/]}) + $event = $schema->resultset('Event')->find_by_id_or_uuid($it, {remove_columns => [qw/orphan/]}) or die error(404 => 'Invalid Event'); } else { - $event = $schema->resultset('Event')->find({event_id => $it}, {remove_columns => [qw/orphan facets/]}) + $event = $schema->resultset('Event')->find_by_id_or_uuid($it, {remove_columns => [qw/orphan facets/]}) or die error(404 => 'Invalid Event'); } - $attrs{order_by} = {-asc => 'event_id'}; + $attrs{order_by} = {-asc => ['event_idx', 'event_sdx', 'event_id']}; if ($route->{from} eq 'single_event') { $res->content_type('application/json'); @@ -47,24 +47,13 @@ sub handle { } if ($p->{load_subtests}) { - # If we are loading subtests then we want ALL descendants, so here - # we take the parent event and find the next event of the same - # nesting level, then we want all events with an event_id between - # them (in the same job); - my $end_at = $schema->resultset('Event')->find( - {%query, nested => $event->nested, event_id => {'>' => $event->event_id}}, - { - columns => [qw/event_id/], - %attrs, - }, - ); - - # FIXME: This should be using event_idx and event_sdx - $query{event_id} = {'>' => $event->event_id, '<' => $end_at->event_id}; + $query{job_try_id} = $event->job_try_id; # Same job try + $query{event_idx} = $event->event_idx; # Same subtest + $query{event_id} = {'!=' => $event->event_id}; # Not this event } else { # We want direct descendants only - $query{'parent_id'} = $it; + $query{'parent_id'} = $event->event_id; } $rs = $schema->resultset('Event')->search( diff --git a/lib/App/Yath/Server/Controller/Files.pm b/lib/App/Yath/Server/Controller/Files.pm index 75995ce7f..c9e721c04 100644 --- a/lib/App/Yath/Server/Controller/Files.pm +++ b/lib/App/Yath/Server/Controller/Files.pm @@ -64,6 +64,8 @@ sub handle { join => ['jobs_tries', 'test_file'], order_by => 'test_file.filename', group_by => ['me.job_id', 'test_file.filename'], + '+select' => [{max => 'jobs_tries.job_try_id'}, {max => 'jobs_tries.job_try_ord'}, {bool_and => 'jobs_tries.fail'}], + '+as' => ['job_try_id', 'job_try_ord', 'fail'], }, ); @@ -74,8 +76,8 @@ sub handle { return $res; } - my $run_id = $run->run_id; - my $run_uri = $req->base . "view/$run_id"; + my $run_uuid = $run->run_uuid; + my $run_uri = $req->base . "view/$run_uuid"; my $field_exclusions = { -and => [ @@ -87,8 +89,8 @@ sub handle { my $data = { last_run_stamp => $run->added->epoch, - run_id => $run_id, - run_uri => $req->base . "view/" . $run->run_id, + run_uuid => $run_uuid, + run_uri => $req->base . "view/" . $run->run_uuid, fields => [$run->run_fields->search($field_exclusions)->all], failures => [], passes => [], @@ -98,21 +100,23 @@ sub handle { my $passes = $data->{passes}; while (my $file = $files->next) { - my $job_key = $file->job_key; - my $job_id = $file->job_id; + my $job_uuid = $file->get_column('job_uuid'); + my $try_id = $file->get_column('job_try_id'); + my $try_ord = $file->get_column('job_try_ord'); + my $fail = $file->get_column('fail'); my $row = { file => $file->file, - fields => [$file->job_fields->search($field_exclusions)->all], - job_id => $job_id, - job_key => $job_key, - uri => "$run_uri/$job_key", + fields => [$schema->resultset('JobTryField')->search({job_try_id => $try_id, %$field_exclusions})->all], + job_uuid => $job_uuid, + job_try => $try_id, + uri => "$run_uri/$job_uuid/$try_ord", }; - if ($file->fail) { + if ($fail) { my $subtests = {}; - my $event_rs = $file->events({nested => 0, is_subtest => 1}); + my $event_rs = $schema->resultset('JobTry')->find({job_try_id => $try_id})->events({nested => 0, is_subtest => 1}); while (my $event = $event_rs->next) { my $f = $event->facets; next unless $f->{assert}; diff --git a/lib/App/Yath/Server/Controller/Stream.pm b/lib/App/Yath/Server/Controller/Stream.pm index 41560decb..9b663cbf1 100644 --- a/lib/App/Yath/Server/Controller/Stream.pm +++ b/lib/App/Yath/Server/Controller/Stream.pm @@ -6,7 +6,7 @@ our $VERSION = '2.000000'; use List::Util qw/max/; use Scalar::Util qw/blessed/; -use App::Yath::Schema::Util qw/find_job/; +use App::Yath::Schema::Util qw/find_job_and_try format_uuid_for_db/; use Test2::Util::UUID qw/looks_like_uuid/; use App::Yath::Server::Response qw/resp error/; @@ -18,6 +18,7 @@ use parent 'App::Yath::Server::Controller'; use Test2::Harness::Util::HashBase qw{ 100; @@ -159,7 +160,10 @@ sub stream_jobs { if (my $job_uuid = $route->{job}) { my $schema = $self->schema; - return $self->stream_single(%params, item => find_job($schema, $job_uuid, $route->{try})); + my ($job, $try) = find_job_and_try($schema, $job_uuid, $route->{try}); + $self->{+JOB} = $job; + $self->{+TRY} = $try; + return $self->stream_single(%params, item => $job); } return $self->stream_set(%params); @@ -170,13 +174,14 @@ sub stream_events { my ($req, $route) = @_; my $job = $self->{+JOB} // return; + my $try = $self->{+TRY} // return; # we only stream nested events when the job is still running - my $query = $job->complete ? {nested => 0} : undef; + my $query = $try->complete ? {nested => 0} : undef; return $self->stream_set( type => 'event', - parent => $job, + parent => $try, req => $req, @@ -187,7 +192,7 @@ sub stream_events { sort_dir => '-asc', method => 'line_data', custom_query => $query, - search_base => scalar($job->events), + search_base => scalar($try->events), ); } @@ -208,6 +213,7 @@ sub stream_single { $it = $params{item} or die error(404 => "Invalid Item"); } else { + $id = format_uuid_for_db($id) if $id_field =~ m/_uuid$/; $it = $search_base->search({%$custom_query, "me.$id_field" => $id}, $custom_opts)->first or die error(404 => "Invalid $type"); } $self->{$type} = $it; @@ -228,7 +234,7 @@ sub stream_single { return if $unchanged; - my $data = $method ? $it->$method : $it->TO_JSON; + my ($data) = $method ? $it->$method : $it->TO_JSON; return encode_json({type => $type, update => $update, data => $data}) . "\n"; }, ]; @@ -255,11 +261,12 @@ sub stream_set { my $order_by = $params{order_by} // $sort_field ? {$sort_dir => $sort_field} : croak "Must specify either 'order_by' or 'sort_field'"; my $items = $search_base->search($custom_query, {%$custom_opts, order_by => $order_by, $limit ? (rows => $limit) : ()}); - my @buffer; + my (@buffer, $buffer_item); my $start = time; my $ord; my $incomplete = {}; + my $update; return [ sub { @@ -291,6 +298,7 @@ sub stream_set { }; my @ids = $track ? keys %$incomplete : (); + @ids = map { format_uuid_for_db($_) } @ids if $id_field =~ m/_uuid$/; $query = [$query, {"me.$id_field" => { -in => \@ids }}] if @ids; $items = $search_base->search( @@ -299,27 +307,41 @@ sub stream_set { ); } - while (my $item = shift(@buffer) || $items->next()) { - $ord = max($ord || 0, $item->$ord_field); + while (1) { + my ($item); - my $update = JSON::PP::false; - if ($track) { - my $id = $item->$id_field; - if (my $old = $incomplete->{$id}) { - $update = JSON::PP::true; - # Nothing has changed, no need to send it. - next if $old->sig eq $item->sig; + if (@buffer) { + $item = $buffer_item; + } + else { + $item = $items->next() or last; + + $ord = max($ord || 0, $item->$ord_field); + + $update = JSON::PP::false; + + if ($track) { + my $id = $item->$id_field; + if (my $old = $incomplete->{$id}) { + $update = JSON::PP::true; + # Nothing has changed, no need to send it. + next if $old->sig eq $item->sig; + } + + if ($item->complete) { + delete $incomplete->{$id}; + } + else { + $incomplete->{$id} = $item; + } } + } - if ($item->complete) { - delete $incomplete->{$id}; - } - else { - $incomplete->{$id} = $item; - } + unless (@buffer) { + @buffer = $method ? $item->$method : $item->TO_JSON; + $buffer_item = $item; } - my @buffer = $method ? $item->$method : $item->TO_JSON; return encode_json({type => $type, update => $update, data => shift(@buffer)}) . "\n"; } diff --git a/lib/App/Yath/Server/Controller/View.pm b/lib/App/Yath/Server/Controller/View.pm index cb542b8d0..3b9d4f80d 100644 --- a/lib/App/Yath/Server/Controller/View.pm +++ b/lib/App/Yath/Server/Controller/View.pm @@ -6,7 +6,7 @@ our $VERSION = '2.000000'; use Text::Xslate(qw/mark_raw/); use App::Yath::Util qw/share_dir/; -use App::Yath::Schema::Util qw/find_job/; +use App::Yath::Schema::Util qw/find_job_and_try/; use App::Yath::Server::Response qw/resp error/; @@ -57,7 +57,7 @@ sub handle { my $job_try = $route->{try}; if (my $job_uuid = $route->{job}) { - my $job = find_job($schema, $job_uuid, $job_try) or die error(404 => 'Invalid Job'); + my ($job, $try) = find_job_and_try($schema, $job_uuid, $job_try) or die error(404 => 'Invalid Job'); $self->{+TITLE} .= ">" . ($job->shortest_file // 'HARNESS'); push @url => $job_uuid; } diff --git a/lib/App/Yath/Server/Request.pm b/lib/App/Yath/Server/Request.pm index ca3e73417..498b79fd8 100644 --- a/lib/App/Yath/Server/Request.pm +++ b/lib/App/Yath/Server/Request.pm @@ -7,6 +7,7 @@ our $VERSION = '2.000000'; use Carp qw/croak/; use Test2::Util::UUID qw/gen_uuid/; +use App::Yath::Schema::Util qw/format_uuid_for_db/; use parent 'Plack::Request'; use Test2::Harness::Util::HashBase qw{ @@ -41,8 +42,9 @@ sub session { $session = undef unless $session && $session->active; } + my $uuid = gen_uuid(); $session ||= $schema->resultset('Session')->create( - {session_uuid => gen_uuid}, + {session_uuid => format_uuid_for_db($uuid)}, ); return $self->{+SESSION} = $session; diff --git a/share/js/eventtable.js b/share/js/eventtable.js index 97469f13c..8b5236a9e 100644 --- a/share/js/eventtable.js +++ b/share/js/eventtable.js @@ -66,6 +66,7 @@ t2hui.eventtable.build_table = function(run, job, controls) { t2hui.eventtable.expand_lines = function(item) { var out = []; + var tools = true; var count = 0; item.lines.forEach(function(line) { @@ -178,7 +179,7 @@ t2hui.eventtable.place_row = function(row, item, table, state) { var pid = item.item['parent_id']; if (!state[pid]) { - var got = table.table.find('tr[data-event-id="' + item.item.parent_id + '"]'); + var got = $('tr[data-event-id="' + item.item.parent_uuid + '"]'); state[pid] = got.last(); } diff --git a/share/js/jobtable.js b/share/js/jobtable.js index efdac754e..4f9001eb7 100644 --- a/share/js/jobtable.js +++ b/share/js/jobtable.js @@ -96,14 +96,17 @@ t2hui.jobtable.tool_builder = function(item, tools, data) { }); }); - var link = base_uri + 'view/' + item.run_uuid + '/' + item.job_uuid; + var link = base_uri + 'view/' + item.run_uuid + '/' + item.job_uuid + '/' + item.job_try_ord; var go = $(''); tools.append(go); }; t2hui.jobtable.modify_row = function(row, item) { if (item.short_file) { - if (item.retry == true) { + if (item.is_harness_out) { + row.addClass('harness_out'); + } + else if (item.retry == true) { row.addClass('iffy_set'); row.addClass('retry_txt'); } @@ -157,7 +160,7 @@ t2hui.jobtable.init_table = function(table, state) { } t2hui.jobtable.place_row = function(row, item, table, state, existing) { - if (!item.short_file) { + if (item.is_harness_out) { state['header'].after(row); return true; } diff --git a/share/js/runtable.js b/share/js/runtable.js index 8af416df8..84ef6d908 100644 --- a/share/js/runtable.js +++ b/share/js/runtable.js @@ -46,12 +46,12 @@ t2hui.runtable.place_row = function(row, item, table, state, existing) { } if (!state['biggest']) { - state['biggest'] = item.run_ord; + state['biggest'] = item.run_id; return false; } - if (item.run_ord > state.biggest) { - state['biggest'] = item.run_ord; + if (item.run_id > state.biggest) { + state['biggest'] = item.run_id; table.body.prepend(row); return true; } diff --git a/share/js/view.js b/share/js/view.js index 2b19ffeb5..b9adbf3c8 100644 --- a/share/js/view.js +++ b/share/js/view.js @@ -46,7 +46,7 @@ $(function() { jobs.append(job_table.render()); state.job_table = job_table; } - state.job_table.render_item(item.data, item.data.job_uuid); + state.job_table.render_item(item.data, item.data.job_try_id); } else if (item.type === 'run') { state.run = item.data; diff --git a/share/schema/MariaDB.sql b/share/schema/MariaDB.sql index 0615525c0..72527c3d0 100644 --- a/share/schema/MariaDB.sql +++ b/share/schema/MariaDB.sql @@ -1,472 +1,412 @@ +CREATE TABLE versions( + version NUMERIC(10,6) NOT NULL, + version_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + updated TIMESTAMP NOT NULL DEFAULT now(), + + UNIQUE(version) +); + +INSERT INTO versions(version) VALUES('2.000000'); + CREATE TABLE config( - config_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - setting VARCHAR(128) NOT NULL, - value VARCHAR(256) NOT NULL, + config_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + setting VARCHAR(128) NOT NULL, + value VARCHAR(256) NOT NULL, + UNIQUE(setting) ); CREATE TABLE users ( - user_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(64) NOT NULL, - pw_hash VARCHAR(31) DEFAULT NULL, - pw_salt VARCHAR(22) DEFAULT NULL, - realname TEXT DEFAULT NULL, - role ENUM( - 'admin', -- Can add users and set permissions - 'user' -- Can manage reports for their projects - ) NOT NULL DEFAULT 'user', + user_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + pw_hash VARCHAR(31) DEFAULT NULL, + pw_salt VARCHAR(22) DEFAULT NULL, + + role ENUM('admin', 'user') + NOT NULL DEFAULT 'user', + + username VARCHAR(64) NOT NULL, + realname TEXT DEFAULT NULL, UNIQUE(username) ); CREATE TABLE email ( - email_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + verified BOOL NOT NULL DEFAULT FALSE, + local VARCHAR(128) NOT NULL, domain VARCHAR(128) NOT NULL, - verified BOOL NOT NULL DEFAULT FALSE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, UNIQUE(local, domain) ); -CREATE INDEX email_user ON email(user_idx); +CREATE INDEX IF NOT EXISTS email_user ON email(user_id); CREATE TABLE primary_email ( - user_idx BIGINT NOT NULL PRIMARY KEY, - email_idx BIGINT NOT NULL, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE, + user_id BIGINT NOT NULL PRIMARY KEY REFERENCES users(user_id) ON DELETE CASCADE, + email_id BIGINT NOT NULL REFERENCES email(email_id) ON DELETE CASCADE, - unique(email_idx) + unique(email_id) ); CREATE TABLE hosts ( - host_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + host_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, hostname VARCHAR(512) NOT NULL, unique(hostname) ); CREATE TABLE email_verification_codes ( - email_idx BIGINT NOT NULL PRIMARY KEY, - evcode_id UUID NOT NULL, - - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE + evcode UUID NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY REFERENCES email(email_id) ON DELETE CASCADE ); CREATE TABLE sessions ( - session_id UUID NOT NULL PRIMARY KEY, - active BOOL DEFAULT TRUE -) ROW_FORMAT=COMPRESSED; + session_uuid UUID NOT NULL, + session_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + active BOOL DEFAULT TRUE, -CREATE TABLE session_hosts ( - session_host_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT, - session_id UUID NOT NULL, + UNIQUE(session_uuid) +); - created TIMESTAMP NOT NULL DEFAULT now(), - accessed TIMESTAMP NOT NULL DEFAULT now(), +CREATE TABLE session_hosts ( + session_host_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT REFERENCES users(user_id) ON DELETE CASCADE, + session_id BIGINT NOT NULL REFERENCES sessions(session_id) ON DELETE CASCADE, - address VARCHAR(128) NOT NULL, - agent TEXT NOT NULL, + created TIMESTAMP NOT NULL DEFAULT now(), + accessed TIMESTAMP NOT NULL DEFAULT now(), - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE CASCADE, + address TEXT NOT NULL, + agent TEXT NOT NULL, UNIQUE(address, agent, session_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX session_hosts_session ON session_hosts(session_id); +); +CREATE INDEX IF NOT EXISTS session_hosts_session ON session_hosts(session_id); CREATE TABLE api_keys ( - api_key_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, - name VARCHAR(128) NOT NULL, - value VARCHAR(36) NOT NULL, + value UUID NOT NULL, + api_key_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, - status ENUM( 'active', 'disabled', 'revoked') NOT NULL, + status ENUM( 'active', 'disabled', 'revoked') + NOT NULL DEFAULT 'active', - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, + name VARCHAR(128) NOT NULL, UNIQUE(value) ); -CREATE INDEX api_key_user ON api_keys(user_idx); +CREATE INDEX IF NOT EXISTS api_key_user ON api_keys(user_id); CREATE TABLE log_files ( - log_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - name TEXT NOT NULL, + log_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + name TEXT NOT NULL, local_file TEXT, data LONGBLOB -) ROW_FORMAT=COMPRESSED; +); CREATE TABLE projects ( - project_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + project_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + owner BIGINT DEFAULT NULL REFERENCES users(user_id) ON DELETE SET NULL, name VARCHAR(128) NOT NULL, - owner BIGINT DEFAULT NULL, - FOREIGN KEY (owner) REFERENCES users(user_idx) ON DELETE SET NULL, UNIQUE(name) ); CREATE TABLE permissions ( - permission_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, + permission_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + project_id BIGINT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, updated TIMESTAMP NOT NULL DEFAULT now(), - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - - UNIQUE(project_idx, user_idx) + UNIQUE(project_id, user_id) ); -CREATE TABLE runs ( - run_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, - project_idx BIGINT NOT NULL, - log_file_idx BIGINT DEFAULT NULL, - - run_id UUID NOT NULL, +CREATE TABLE syncs ( + sync_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + last_run_id BIGINT NOT NULL, + last_project_id BIGINT NOT NULL, + last_user_id BIGINT NOT NULL, + source VARCHAR(64) NOT NULL, - status ENUM('pending', 'running', 'complete', 'broken', 'canceled') NOT NULL, - - worker_id VARCHAR(36) DEFAULT NULL, - error TEXT DEFAULT NULL, - - pinned BOOL NOT NULL DEFAULT FALSE, - has_coverage BOOL NOT NULL DEFAULT FALSE, - - -- User Input - added TIMESTAMP NOT NULL DEFAULT now(), - duration VARCHAR(36) DEFAULT NULL, + UNIQUE(source) +); - mode ENUM('qvfds', 'qvfd', 'qvf', 'summary', 'complete') - DEFAULT 'qvfd' NOT NULL, +CREATE TABLE runs ( + run_uuid UUID NOT NULL, - buffer ENUM('none', 'diag', 'job', 'run') - DEFAULT 'job' NOT NULL, + run_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + project_id BIGINT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + log_file_id BIGINT DEFAULT NULL REFERENCES log_files(log_file_id) ON DELETE SET NULL, - -- From Log + sync_id INTEGER DEFAULT NULL REFERENCES syncs(sync_id) ON DELETE SET NULL, passed INTEGER DEFAULT NULL, failed INTEGER DEFAULT NULL, + to_retry INTEGER DEFAULT NULL, retried INTEGER DEFAULT NULL, - concurrency INTEGER DEFAULT NULL, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (log_file_idx) REFERENCES log_files(log_file_idx) ON DELETE SET NULL, - - UNIQUE(run_id) -); -CREATE INDEX run_projects ON runs(project_idx); -CREATE INDEX run_status ON runs(status); -CREATE INDEX run_user ON runs(user_idx); - -CREATE TABLE sweeps ( - sweep_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_idx BIGINT NOT NULL, - name VARCHAR(255) NOT NULL, - - FOREIGN KEY (run_idx) REFERENCES runs(run_idx) ON DELETE CASCADE, + concurrency_j INTEGER DEFAULT NULL, + concurrency_x INTEGER DEFAULT NULL, + added TIMESTAMP NOT NULL DEFAULT now(), - UNIQUE(run_idx, name) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX sweep_runs ON sweeps(run_idx); + status ENUM('pending', 'running', 'complete', 'broken', 'canceled') + NOT NULL DEFAULT 'pending', -CREATE TABLE run_fields ( - run_field_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_field_id UUID NOT NULL, - run_id UUID NOT NULL, - name VARCHAR(255) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, + mode ENUM('qvfds', 'qvfd', 'qvf', 'summary', 'complete') + NOT NULL DEFAULT 'qvfd', - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, + canon BOOL NOT NULL, -- Should be true if sync_id was never set + pinned BOOL NOT NULL DEFAULT FALSE, + has_coverage BOOL DEFAULT NULL, + has_resources BOOL DEFAULT NULL, - UNIQUE(run_field_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX run_fields_run_id ON run_fields(run_id); -CREATE INDEX run_fields_name ON run_fields(name); + parameters JSON DEFAULT NULL, + worker_id TEXT DEFAULT NULL, + error TEXT DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, -CREATE TABLE run_parameters ( - run_parameters_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_id UUID NOT NULL, - parameters JSON DEFAULT NULL, + UNIQUE(run_uuid) +); +CREATE INDEX IF NOT EXISTS run_projects ON runs(project_id); +CREATE INDEX IF NOT EXISTS run_status ON runs(status); +CREATE INDEX IF NOT EXISTS run_user ON runs(user_id); +CREATE INDEX IF NOT EXISTS run_canon ON runs(run_id, canon); - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, +CREATE TABLE sweeps ( + sweep_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + name VARCHAR(64) NOT NULL, - UNIQUE(run_id) -) ROW_FORMAT=COMPRESSED; + UNIQUE(run_id, name) +); +CREATE INDEX IF NOT EXISTS sweep_runs ON sweeps(run_id); CREATE TABLE test_files ( - test_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - filename VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + test_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + filename VARCHAR(255) NOT NULL, UNIQUE(filename) -) ROW_FORMAT=COMPRESSED; - -CREATE TABLE jobs ( - job_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - job_key UUID NOT NULL, - job_id UUID NOT NULL, - run_id UUID NOT NULL, - - test_file_idx BIGINT DEFAULT NULL, - - job_try INT NOT NULL DEFAULT 0, - status ENUM('pending', 'running', 'complete', 'broken', 'canceled') - NOT NULL DEFAULT 'pending', - - is_harness_out BOOL NOT NULL DEFAULT FALSE, +); - -- Summaries - fail BOOL DEFAULT NULL, - retry BOOL DEFAULT NULL, - name TEXT DEFAULT NULL, - exit_code INT DEFAULT NULL, - launch TIMESTAMP DEFAULT NULL, - start TIMESTAMP DEFAULT NULL, - ended TIMESTAMP DEFAULT NULL, +INSERT INTO test_files(filename) VALUES('HARNESS INTERNAL LOG'); - duration DOUBLE PRECISION DEFAULT NULL, +CREATE TABLE jobs ( + job_uuid UUID NOT NULL, - pass_count BIGINT DEFAULT NULL, - fail_count BIGINT DEFAULT NULL, + job_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + test_file_id BIGINT NOT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, + is_harness_out BOOL NOT NULL, + failed BOOL NOT NULL, + passed BOOL DEFAULT NULL, - UNIQUE(job_key), - UNIQUE(job_id, job_try) + UNIQUE(job_uuid) ); -CREATE INDEX job_runs ON jobs(run_id); -CREATE INDEX job_fail ON jobs(fail); -CREATE INDEX job_file ON jobs(test_file_idx); +CREATE INDEX IF NOT EXISTS job_runs ON jobs(run_id); +CREATE INDEX IF NOT EXISTS job_file ON jobs(test_file_id); -CREATE TABLE job_parameters ( - job_parameters_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_key UUID NOT NULL, - parameters JSON DEFAULT NULL, +CREATE TABLE job_tries ( + job_try_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_id BIGINT NOT NULL REFERENCES jobs(job_id) ON DELETE CASCADE, + pass_count BIGINT DEFAULT NULL, + fail_count BIGINT DEFAULT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + exit_code INTEGER DEFAULT NULL, + launch TIMESTAMP DEFAULT NULL, + start TIMESTAMP DEFAULT NULL, + ended TIMESTAMP DEFAULT NULL, - UNIQUE(job_key) -) ROW_FORMAT=COMPRESSED; -CREATE TABLE job_outputs ( - job_output_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_key UUID NOT NULL, + status ENUM('pending', 'running', 'complete', 'broken', 'canceled') + NOT NULL DEFAULT 'pending', - stream ENUM('STDOUT', 'STDERR') - NOT NULL, + job_try_ord SMALLINT NOT NULL, - output TEXT NOT NULL, + fail BOOL DEFAULT NULL, + retry BOOL DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + parameters JSON DEFAULT NULL, + stdout TEXT DEFAULT NULL, + stderr TEXT DEFAULT NULL, - UNIQUE(job_key, stream) + UNIQUE(job_try_id, job_try_ord) ); +CREATE INDEX IF NOT EXISTS job_try_fail ON job_tries(fail); +CREATE INDEX IF NOT EXISTS job_try_job_fail ON job_tries(job_id, fail); -CREATE TABLE job_fields ( - job_field_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_field_id UUID NOT NULL, - job_key UUID NOT NULL, - name VARCHAR(512) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, +CREATE TABLE events ( + event_uuid UUID NOT NULL, + trace_uuid UUID DEFAULT NULL, + parent_uuid UUID DEFAULT NULL REFERENCES events(event_uuid), - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + event_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_try_id BIGINT NOT NULL REFERENCES job_tries(job_try_id) ON DELETE CASCADE, + parent_id BIGINT DEFAULT NULL REFERENCES events(event_id) ON DELETE CASCADE, - UNIQUE(job_field_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX job_fields_job_key ON job_fields(job_key); -CREATE INDEX job_fields_name ON job_fields(name); + event_idx INTEGER NOT NULL, -- Line number from log, or event number from stream + event_sdx INTEGER NOT NULL, -- Event sequence number from the line (IE parent + subtest events) + stamp TIMESTAMP DEFAULT NULL, -CREATE TABLE events ( - event_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - event_id UUID NOT NULL, + nested SMALLINT NOT NULL, - job_key UUID NOT NULL, + is_subtest BOOL NOT NULL, + is_diag BOOL NOT NULL, + is_harness BOOL NOT NULL, + is_time BOOL NOT NULL, - is_subtest BOOL NOT NULL, - is_diag BOOL NOT NULL, - is_harness BOOL NOT NULL, - is_time BOOL NOT NULL, - is_assert BOOL NOT NULL, + causes_fail BOOL NOT NULL, - causes_fail BOOL NOT NULL, + has_facets BOOL NOT NULL, + has_orphan BOOL NOT NULL, + has_binary BOOL NOT NULL, - has_binary BOOL NOT NULL, - has_facets BOOL NOT NULL, - has_orphan BOOL NOT NULL, + facets JSON DEFAULT NULL, + orphan JSON DEFAULT NULL, + rendered JSON DEFAULT NULL, - stamp TIMESTAMP DEFAULT NULL, + UNIQUE(job_try_id, event_idx, event_sdx), + UNIQUE(event_uuid) +); +CREATE INDEX IF NOT EXISTS event_parent ON events(parent_id); +CREATE INDEX IF NOT EXISTS event_job_ts ON events(job_try_id, stamp); +CREATE INDEX IF NOT EXISTS event_job_st ON events(job_try_id, is_subtest); + +CREATE TABLE binaries ( + event_uuid UUID NOT NULL, - parent_id UUID DEFAULT NULL, - trace_id UUID DEFAULT NULL, - nested INT NOT NULL DEFAULT 0, + binary_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + event_id BIGINT DEFAULT NULL REFERENCES events(event_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - -- FOREIGN KEY (parent_id) REFERENCES events(event_id), + is_image BOOL NOT NULL DEFAULT FALSE, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX event_job_ts ON events(job_key, stamp); -CREATE INDEX event_job_st ON events(job_key, is_subtest); -CREATE INDEX event_trace ON events(trace_id); -CREATE INDEX event_parent ON events(parent_id); + filename VARCHAR(512) NOT NULL, + description TEXT DEFAULT NULL, + data LONGBLOB NOT NULL +); +CREATE INDEX IF NOT EXISTS binaries_event ON binaries(event_id); -CREATE TABLE renders ( - event_id UUID NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, +CREATE TABLE run_fields ( + event_uuid UUID NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + run_field_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL +); +CREATE INDEX IF NOT EXISTS run_fields_run_id ON run_fields(run_id); +CREATE INDEX IF NOT EXISTS run_fields_name ON run_fields(name); -CREATE TABLE facets ( - event_id UUID NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, +CREATE TABLE job_try_fields ( + event_uuid UUID NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + job_field_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_try_id BIGINT NOT NULL REFERENCES job_tries(job_try_id) ON DELETE CASCADE, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL +); +CREATE INDEX IF NOT EXISTS job_try_fields_job_id ON job_try_fields(job_try_id); +CREATE INDEX IF NOT EXISTS job_try_fields_name ON job_try_fields(name); -CREATE TABLE orphans ( - event_id UUID NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, +CREATE TABLE source_files ( + source_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + filename VARCHAR(512) NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + UNIQUE(filename) +); - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; +CREATE TABLE source_subs ( + source_sub_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + subname VARCHAR(512) NOT NULL, -CREATE TABLE binaries ( - binary_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - event_id UUID NOT NULL, - filename VARCHAR(512) NOT NULL, - description TEXT DEFAULT NULL, - is_image BOOL NOT NULL DEFAULT FALSE, - data LONGBLOB NOT NULL, + UNIQUE(subname) +); - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX binaries_event ON binaries(event_id); +CREATE TABLE resource_types( + resource_type_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(512) NOT NULL, -CREATE TABLE source_files ( - source_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + UNIQUE(name) +); - filename VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, +CREATE TABLE resources ( + event_uuid UUID NOT NULL, - UNIQUE(filename) -) ROW_FORMAT=COMPRESSED; + resource_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + resource_type_id BIGINT NOT NULL REFERENCES resource_types(resource_type_id) ON DELETE CASCADE, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + host_id BIGINT REFERENCES hosts(host_id) ON DELETE SET NULL, -CREATE TABLE source_subs ( - source_sub_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + stamp TIMESTAMP NOT NULL, + resource_ord INTEGER NOT NULL, - subname VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + data JSON NOT NULL, - UNIQUE(subname) -) ROW_FORMAT=COMPRESSED; + UNIQUE(run_id, resource_ord) +); +CREATE INDEX IF NOT EXISTS res_data_runs ON resources(run_id); +CREATE INDEX IF NOT EXISTS res_data_res ON resources(resource_type_id); +CREATE INDEX IF NOT EXISTS res_data_runs_and_res ON resources(run_id, resource_type_id); CREATE TABLE coverage_manager ( - coverage_manager_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - package VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + coverage_manager_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + package VARCHAR(256) NOT NULL, UNIQUE(package) -) ROW_FORMAT=COMPRESSED; +); CREATE TABLE coverage ( - coverage_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + event_uuid UUID NOT NULL, - run_id UUID NOT NULL, - job_key UUID DEFAULT NULL, + coverage_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, - test_file_idx BIGINT NOT NULL, - source_file_idx BIGINT NOT NULL, - source_sub_idx BIGINT NOT NULL, - coverage_manager_idx BIGINT DEFAULT NULL, + job_try_id BIGINT DEFAULT NULL REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + coverage_manager_id BIGINT DEFAULT NULL REFERENCES coverage_manager(coverage_manager_id) ON DELETE CASCADE, - metadata JSON DEFAULT NULL, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + test_file_id BIGINT NOT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, + source_file_id BIGINT NOT NULL REFERENCES source_files(source_file_id) ON DELETE CASCADE, + source_sub_id BIGINT NOT NULL REFERENCES source_subs(source_sub_id) ON DELETE CASCADE, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_file_idx) REFERENCES source_files(source_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_sub_idx) REFERENCES source_subs(source_sub_idx) ON DELETE CASCADE, - FOREIGN KEY (coverage_manager_idx) REFERENCES coverage_manager(coverage_manager_idx) ON DELETE CASCADE, + metadata JSON DEFAULT NULL, - UNIQUE(run_id, job_key, test_file_idx, source_file_idx, source_sub_idx) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX coverage_from_source ON coverage(source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_run_source ON coverage(run_id, source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_job ON coverage(job_key); + UNIQUE(run_id, job_try_id, test_file_id, source_file_id, source_sub_id) +); +CREATE INDEX IF NOT EXISTS coverage_from_source ON coverage(source_file_id, source_sub_id); +CREATE INDEX IF NOT EXISTS coverage_from_run_source ON coverage(run_id, source_file_id, source_sub_id); +CREATE INDEX IF NOT EXISTS coverage_from_job ON coverage(job_try_id); CREATE TABLE reporting ( - reporting_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, - run_id UUID NOT NULL, - - test_file_idx BIGINT DEFAULT NULL, - job_key UUID DEFAULT NULL, - event_id UUID DEFAULT NULL, - - job_try INT DEFAULT NULL, - subtest VARCHAR(512) DEFAULT NULL, - duration DOUBLE PRECISION NOT NULL, - - fail SMALLINT NOT NULL DEFAULT 0, - pass SMALLINT NOT NULL DEFAULT 0, - retry SMALLINT NOT NULL DEFAULT 0, - abort SMALLINT NOT NULL DEFAULT 0, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE -); -CREATE INDEX reporting_user ON reporting(user_idx); -CREATE INDEX reporting_run ON reporting(run_id); -CREATE INDEX reporting_a ON reporting(project_idx); -CREATE INDEX reporting_b ON reporting(project_idx, user_idx); -CREATE INDEX reporting_e ON reporting(project_idx, test_file_idx, subtest, user_idx, reporting_idx); - -CREATE TABLE resource_batch ( - resource_batch_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_id UUID NOT NULL, - host_idx BIGINT NOT NULL, - stamp TIMESTAMP(4) NOT NULL, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (host_idx) REFERENCES hosts(host_idx) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX resource_batch_run ON resource_batch(run_id); + reporting_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, -CREATE TABLE resources ( - resource_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - resource_batch_idx BIGINT NOT NULL, - module VARCHAR(512) NOT NULL, - data JSON NOT NULL, - - FOREIGN KEY (resource_batch_idx) REFERENCES resource_batch(resource_batch_idx) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX resources_batch_idx ON resources(resource_batch_idx); + job_try_id BIGINT DEFAULT NULL REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + test_file_id BIGINT DEFAULT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, + + project_id BIGINT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + + job_try SMALLINT DEFAULT NULL, + + retry SMALLINT NOT NULL, + abort SMALLINT NOT NULL, + fail SMALLINT NOT NULL, + pass SMALLINT NOT NULL, + + subtest VARCHAR(512) DEFAULT NULL, + duration NUMERIC(14,4) NOT NULL +); +CREATE INDEX IF NOT EXISTS reporting_run ON reporting(run_id); +CREATE INDEX IF NOT EXISTS reporting_user ON reporting(user_id); +CREATE INDEX IF NOT EXISTS reporting_a ON reporting(project_id); +CREATE INDEX IF NOT EXISTS reporting_b ON reporting(project_id, user_id); +CREATE INDEX IF NOT EXISTS reporting_e ON reporting(project_id, test_file_id, subtest, user_id, reporting_id); diff --git a/share/schema/MySQL.sql b/share/schema/MySQL.sql index e0f99b1d1..51111f758 100644 --- a/share/schema/MySQL.sql +++ b/share/schema/MySQL.sql @@ -1,469 +1,413 @@ +CREATE TABLE versions( + version NUMERIC(10,6) NOT NULL, + version_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + updated TIMESTAMP NOT NULL DEFAULT now(), + + UNIQUE(version) +); + +INSERT INTO versions(version) VALUES('2.000000'); + CREATE TABLE config( - config_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - setting VARCHAR(128) NOT NULL, - value VARCHAR(256) NOT NULL, + config_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + setting VARCHAR(128) NOT NULL, + value VARCHAR(256) NOT NULL, + UNIQUE(setting) ); CREATE TABLE users ( - user_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(64) NOT NULL, - pw_hash VARCHAR(31) DEFAULT NULL, - pw_salt VARCHAR(22) DEFAULT NULL, - realname TEXT DEFAULT NULL, - role ENUM( - 'admin', -- Can add users and set permissions - 'user' -- Can manage reports for their projects - ) NOT NULL DEFAULT 'user', + user_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + pw_hash VARCHAR(31) DEFAULT NULL, + pw_salt VARCHAR(22) DEFAULT NULL, + + role ENUM('admin', 'user') + NOT NULL DEFAULT 'user', + + username VARCHAR(64) NOT NULL, + realname TEXT DEFAULT NULL, UNIQUE(username) ); CREATE TABLE email ( - email_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + verified BOOL NOT NULL DEFAULT FALSE, + local VARCHAR(128) NOT NULL, domain VARCHAR(128) NOT NULL, - verified BOOL NOT NULL DEFAULT FALSE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, UNIQUE(local, domain) ); -CREATE INDEX email_user ON email(user_idx); +CREATE INDEX IF NOT EXISTS email_user ON email(user_id); CREATE TABLE primary_email ( - user_idx BIGINT NOT NULL PRIMARY KEY, - email_idx BIGINT NOT NULL, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE, + user_id BIGINT NOT NULL PRIMARY KEY REFERENCES users(user_id) ON DELETE CASCADE, + email_id BIGINT NOT NULL REFERENCES email(email_id) ON DELETE CASCADE, - unique(email_idx) + unique(email_id) ); CREATE TABLE hosts ( - host_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + host_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, hostname VARCHAR(512) NOT NULL, unique(hostname) ); CREATE TABLE email_verification_codes ( - email_idx BIGINT NOT NULL PRIMARY KEY, - evcode_id BINARY(16) NOT NULL, - - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE + evcode UUID NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY REFERENCES email(email_id) ON DELETE CASCADE ); CREATE TABLE sessions ( - session_id BINARY(16) NOT NULL PRIMARY KEY, - active BOOL DEFAULT TRUE -) ROW_FORMAT=COMPRESSED; + session_uuid UUID NOT NULL, + session_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + active BOOL DEFAULT TRUE, -CREATE TABLE session_hosts ( - session_host_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT, - session_id BINARY(16) NOT NULL, + UNIQUE(session_uuid) +); - created TIMESTAMP NOT NULL DEFAULT now(), - accessed TIMESTAMP NOT NULL DEFAULT now(), +CREATE TABLE session_hosts ( + session_host_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT REFERENCES users(user_id) ON DELETE CASCADE, + session_id BIGINT NOT NULL REFERENCES sessions(session_id) ON DELETE CASCADE, - address VARCHAR(128) NOT NULL, - agent VARCHAR(128) NOT NULL, + created TIMESTAMP NOT NULL DEFAULT now(), + accessed TIMESTAMP NOT NULL DEFAULT now(), - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE CASCADE, + address TEXT NOT NULL, + agent TEXT NOT NULL, UNIQUE(address, agent, session_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX session_hosts_session ON session_hosts(session_id); +); +CREATE INDEX IF NOT EXISTS session_hosts_session ON session_hosts(session_id); CREATE TABLE api_keys ( - api_key_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, - name VARCHAR(128) NOT NULL, - value VARCHAR(36) NOT NULL, + value UUID NOT NULL, + api_key_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, - status ENUM( 'active', 'disabled', 'revoked') NOT NULL, + status ENUM( 'active', 'disabled', 'revoked') + NOT NULL DEFAULT 'active', - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, + name VARCHAR(128) NOT NULL, UNIQUE(value) ); -CREATE INDEX api_key_user ON api_keys(user_idx); +CREATE INDEX IF NOT EXISTS api_key_user ON api_keys(user_id); CREATE TABLE log_files ( - log_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - name TEXT NOT NULL, + log_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + name TEXT NOT NULL, local_file TEXT, data LONGBLOB -) ROW_FORMAT=COMPRESSED; +); CREATE TABLE projects ( - project_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + project_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + owner BIGINT DEFAULT NULL REFERENCES users(user_id) ON DELETE SET NULL, name VARCHAR(128) NOT NULL, - owner BIGINT DEFAULT NULL, - FOREIGN KEY (owner) REFERENCES users(user_idx) ON DELETE SET NULL, UNIQUE(name) ); CREATE TABLE permissions ( - permission_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, + permission_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + project_id BIGINT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, updated TIMESTAMP NOT NULL DEFAULT now(), - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - - UNIQUE(project_idx, user_idx) + UNIQUE(project_id, user_id) ); -CREATE TABLE runs ( - run_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, - project_idx BIGINT NOT NULL, - log_file_idx BIGINT DEFAULT NULL, +CREATE TABLE syncs ( + sync_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + last_run_id BIGINT NOT NULL, + last_project_id BIGINT NOT NULL, + last_user_id BIGINT NOT NULL, + source VARCHAR(64) NOT NULL, - run_id BINARY(16) NOT NULL, + UNIQUE(source) +); - status ENUM('pending', 'running', 'complete', 'broken', 'canceled') NOT NULL, +CREATE TABLE runs ( + run_uuid UUID NOT NULL, - worker_id VARCHAR(36) DEFAULT NULL, - error TEXT DEFAULT NULL, + run_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + project_id BIGINT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + log_file_id BIGINT DEFAULT NULL REFERENCES log_files(log_file_id) ON DELETE SET NULL, - pinned BOOL NOT NULL DEFAULT FALSE, - has_coverage BOOL NOT NULL DEFAULT FALSE, + sync_id INTEGER DEFAULT NULL REFERENCES syncs(sync_id) ON DELETE SET NULL, + passed INTEGER DEFAULT NULL, + failed INTEGER DEFAULT NULL, + to_retry INTEGER DEFAULT NULL, + retried INTEGER DEFAULT NULL, + concurrency_j INTEGER DEFAULT NULL, + concurrency_x INTEGER DEFAULT NULL, + added TIMESTAMP NOT NULL DEFAULT now(), - -- User Input - added TIMESTAMP NOT NULL DEFAULT now(), - duration VARCHAR(36) DEFAULT NULL, + status ENUM('pending', 'running', 'complete', 'broken', 'canceled') + NOT NULL DEFAULT 'pending', mode ENUM('qvfds', 'qvfd', 'qvf', 'summary', 'complete') - DEFAULT 'qvfd' NOT NULL, + NOT NULL DEFAULT 'qvfd', - buffer ENUM('none', 'diag', 'job', 'run') - DEFAULT 'job' NOT NULL, + canon BOOL NOT NULL, -- Should be true if sync_id was never set + pinned BOOL NOT NULL DEFAULT FALSE, + has_coverage BOOL DEFAULT NULL, + has_resources BOOL DEFAULT NULL, - -- From Log - passed INTEGER DEFAULT NULL, - failed INTEGER DEFAULT NULL, - retried INTEGER DEFAULT NULL, - concurrency INTEGER DEFAULT NULL, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (log_file_idx) REFERENCES log_files(log_file_idx) ON DELETE SET NULL, + parameters JSON DEFAULT NULL, + worker_id TEXT DEFAULT NULL, + error TEXT DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - UNIQUE(run_id) + UNIQUE(run_uuid) ); -CREATE INDEX run_projects ON runs(project_idx); -CREATE INDEX run_status ON runs(status); -CREATE INDEX run_user ON runs(user_idx); +CREATE INDEX IF NOT EXISTS run_projects ON runs(project_id); +CREATE INDEX IF NOT EXISTS run_status ON runs(status); +CREATE INDEX IF NOT EXISTS run_user ON runs(user_id); +CREATE INDEX IF NOT EXISTS run_canon ON runs(run_id, canon); CREATE TABLE sweeps ( - sweep_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_idx BIGINT NOT NULL, - name VARCHAR(255) NOT NULL, - - FOREIGN KEY (run_idx) REFERENCES runs(run_idx) ON DELETE CASCADE, - - UNIQUE(run_idx, name) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX sweep_runs ON sweeps(run_idx); + sweep_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + name VARCHAR(64) NOT NULL, -CREATE TABLE run_fields ( - run_field_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_field_id BINARY(16) NOT NULL, - run_id BINARY(16) NOT NULL, - name VARCHAR(255) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, + UNIQUE(run_id, name) +); +CREATE INDEX IF NOT EXISTS sweep_runs ON sweeps(run_id); - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, +CREATE TABLE test_files ( + test_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + filename VARCHAR(255) NOT NULL, - UNIQUE(run_field_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX run_fields_run_id ON run_fields(run_id); -CREATE INDEX run_fields_name ON run_fields(name); + UNIQUE(filename) +); -CREATE TABLE run_parameters ( - run_parameters_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_id BINARY(16) NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - parameters JSON DEFAULT NULL, +INSERT INTO test_files(filename) VALUES('HARNESS INTERNAL LOG'); - UNIQUE(run_id) -) ROW_FORMAT=COMPRESSED; +CREATE TABLE jobs ( + job_uuid UUID NOT NULL, -CREATE TABLE test_files ( - test_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + job_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + test_file_id BIGINT NOT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, - filename VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + is_harness_out BOOL NOT NULL, + failed BOOL NOT NULL, + passed BOOL DEFAULT NULL, - UNIQUE(filename) -) ROW_FORMAT=COMPRESSED; + UNIQUE(job_uuid) +); +CREATE INDEX IF NOT EXISTS job_runs ON jobs(run_id); +CREATE INDEX IF NOT EXISTS job_file ON jobs(test_file_id); -CREATE TABLE jobs ( - job_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, +CREATE TABLE job_tries ( + job_try_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_id BIGINT NOT NULL REFERENCES jobs(job_id) ON DELETE CASCADE, + pass_count BIGINT DEFAULT NULL, + fail_count BIGINT DEFAULT NULL, - job_key BINARY(16) NOT NULL, - job_id BINARY(16) NOT NULL, - run_id BINARY(16) NOT NULL, + exit_code INTEGER DEFAULT NULL, + launch TIMESTAMP DEFAULT NULL, + start TIMESTAMP DEFAULT NULL, + ended TIMESTAMP DEFAULT NULL, - test_file_idx BIGINT DEFAULT NULL, - job_try INT NOT NULL DEFAULT 0, status ENUM('pending', 'running', 'complete', 'broken', 'canceled') - NOT NULL DEFAULT 'pending', + NOT NULL DEFAULT 'pending', - is_harness_out BOOL NOT NULL DEFAULT FALSE, + job_try_ord SMALLINT NOT NULL, - -- Summaries - fail BOOL DEFAULT NULL, - retry BOOL DEFAULT NULL, - name TEXT DEFAULT NULL, - exit_code INT DEFAULT NULL, - launch TIMESTAMP DEFAULT NULL, - start TIMESTAMP DEFAULT NULL, - ended TIMESTAMP DEFAULT NULL, + fail BOOL DEFAULT NULL, + retry BOOL DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - duration DOUBLE PRECISION DEFAULT NULL, + parameters JSON DEFAULT NULL, + stdout TEXT DEFAULT NULL, + stderr TEXT DEFAULT NULL, - pass_count BIGINT DEFAULT NULL, - fail_count BIGINT DEFAULT NULL, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, - - UNIQUE(job_key), - UNIQUE(job_id, job_try) + UNIQUE(job_try_id, job_try_ord) ); -CREATE INDEX job_runs ON jobs(run_id); -CREATE INDEX job_fail ON jobs(fail); -CREATE INDEX job_file ON jobs(test_file_idx); +CREATE INDEX IF NOT EXISTS job_try_fail ON job_tries(fail); +CREATE INDEX IF NOT EXISTS job_try_job_fail ON job_tries(job_id, fail); -CREATE TABLE job_parameters ( - job_parameters_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_key BINARY(16) NOT NULL REFERENCES jobs(job_key) ON DELETE CASCADE, - parameters JSON DEFAULT NULL, +CREATE TABLE events ( + event_uuid UUID NOT NULL, + trace_uuid UUID DEFAULT NULL, + parent_uuid UUID DEFAULT NULL REFERENCES events(event_uuid), - UNIQUE(job_key) -) ROW_FORMAT=COMPRESSED; + event_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_try_id BIGINT NOT NULL REFERENCES job_tries(job_try_id) ON DELETE CASCADE, + parent_id BIGINT DEFAULT NULL REFERENCES events(event_id) ON DELETE CASCADE, -CREATE TABLE job_outputs ( - job_output_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_key BINARY(16) NOT NULL, + event_idx INTEGER NOT NULL, -- Line number from log, or event number from stream + event_sdx INTEGER NOT NULL, -- Event sequence number from the line (IE parent + subtest events) + stamp TIMESTAMP DEFAULT NULL, - stream ENUM('STDOUT', 'STDERR') - NOT NULL, + nested SMALLINT NOT NULL, - output TEXT NOT NULL, + is_subtest BOOL NOT NULL, + is_diag BOOL NOT NULL, + is_harness BOOL NOT NULL, + is_time BOOL NOT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + causes_fail BOOL NOT NULL, - UNIQUE(job_key, stream) -); + has_facets BOOL NOT NULL, + has_orphan BOOL NOT NULL, + has_binary BOOL NOT NULL, -CREATE TABLE job_fields ( - job_field_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_field_id BINARY(16) NOT NULL, - job_key BINARY(16) NOT NULL, - name VARCHAR(512) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, - - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + facets JSON DEFAULT NULL, + orphan JSON DEFAULT NULL, + rendered JSON DEFAULT NULL, - UNIQUE(job_field_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX job_fields_job_key ON job_fields(job_key); -CREATE INDEX job_fields_name ON job_fields(name); - -CREATE TABLE events ( - event_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - event_id BINARY(16) NOT NULL, + UNIQUE(job_try_id, event_idx, event_sdx), + UNIQUE(event_uuid) +); +CREATE INDEX IF NOT EXISTS event_parent ON events(parent_id); +CREATE INDEX IF NOT EXISTS event_job_ts ON events(job_try_id, stamp); +CREATE INDEX IF NOT EXISTS event_job_st ON events(job_try_id, is_subtest); - job_key BINARY(16) NOT NULL, +CREATE TABLE binaries ( + event_uuid UUID NOT NULL, - is_subtest BOOL NOT NULL, - is_diag BOOL NOT NULL, - is_harness BOOL NOT NULL, - is_time BOOL NOT NULL, - is_assert BOOL NOT NULL, + binary_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + event_id BIGINT DEFAULT NULL REFERENCES events(event_id) ON DELETE CASCADE, - causes_fail BOOL NOT NULL, + is_image BOOL NOT NULL DEFAULT FALSE, - has_binary BOOL NOT NULL, - has_facets BOOL NOT NULL, - has_orphan BOOL NOT NULL, + filename VARCHAR(512) NOT NULL, + description TEXT DEFAULT NULL, + data LONGBLOB NOT NULL +); +CREATE INDEX IF NOT EXISTS binaries_event ON binaries(event_id); - stamp TIMESTAMP DEFAULT NULL, +CREATE TABLE run_fields ( + event_uuid UUID NOT NULL, - parent_id BINARY(16) DEFAULT NULL, - trace_id VARCHAR(36) DEFAULT NULL, - nested INT NOT NULL DEFAULT 0, + run_field_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - -- FOREIGN KEY (parent_id) REFERENCES events(event_id), + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL +); +CREATE INDEX IF NOT EXISTS run_fields_run_id ON run_fields(run_id); +CREATE INDEX IF NOT EXISTS run_fields_name ON run_fields(name); - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX event_job_ts ON events(job_key, stamp); -CREATE INDEX event_job_st ON events(job_key, is_subtest); -CREATE INDEX event_trace ON events(trace_id); -CREATE INDEX event_parent ON events(parent_id); +CREATE TABLE job_try_fields ( + event_uuid UUID NOT NULL, -CREATE TABLE renders ( - event_id BINARY(16) NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, + job_field_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_try_id BIGINT NOT NULL REFERENCES job_tries(job_try_id) ON DELETE CASCADE, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL +); +CREATE INDEX IF NOT EXISTS job_try_fields_job_id ON job_try_fields(job_try_id); +CREATE INDEX IF NOT EXISTS job_try_fields_name ON job_try_fields(name); - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; +CREATE TABLE source_files ( + source_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + filename VARCHAR(512) NOT NULL, -CREATE TABLE facets ( - event_id BINARY(16) NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, + UNIQUE(filename) +); - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, +CREATE TABLE source_subs ( + source_sub_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + subname VARCHAR(512) NOT NULL, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; + UNIQUE(subname) +); -CREATE TABLE orphans ( - event_id BINARY(16) NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, +CREATE TABLE resource_types( + resource_type_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(512) NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + UNIQUE(name) +); - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; +CREATE TABLE resources ( + event_uuid UUID NOT NULL, -CREATE TABLE binaries ( - binary_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - event_id BINARY(16) NOT NULL, - filename VARCHAR(512) NOT NULL, - description TEXT DEFAULT NULL, - is_image BOOL NOT NULL DEFAULT FALSE, - data LONGBLOB NOT NULL, + resource_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + resource_type_id BIGINT NOT NULL REFERENCES resource_types(resource_type_id) ON DELETE CASCADE, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + host_id BIGINT REFERENCES hosts(host_id) ON DELETE SET NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX binaries_event ON binaries(event_id); + stamp TIMESTAMP NOT NULL, + resource_ord INTEGER NOT NULL, -CREATE TABLE source_files ( - source_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + data JSON NOT NULL, - filename VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + UNIQUE(run_id, resource_ord) +); +CREATE INDEX IF NOT EXISTS res_data_runs ON resources(run_id); +CREATE INDEX IF NOT EXISTS res_data_res ON resources(resource_type_id); +CREATE INDEX IF NOT EXISTS res_data_runs_and_res ON resources(run_id, resource_type_id); - UNIQUE(filename) -) ROW_FORMAT=COMPRESSED; +CREATE TABLE coverage_manager ( + coverage_manager_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + package VARCHAR(256) NOT NULL, -CREATE TABLE source_subs ( - source_sub_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + UNIQUE(package) +); - subname VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, +CREATE TABLE coverage ( + event_uuid UUID NOT NULL, - UNIQUE(subname) -) ROW_FORMAT=COMPRESSED; + coverage_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, -CREATE TABLE coverage_manager ( - coverage_manager_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + job_try_id BIGINT DEFAULT NULL REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + coverage_manager_id BIGINT DEFAULT NULL REFERENCES coverage_manager(coverage_manager_id) ON DELETE CASCADE, - package VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + test_file_id BIGINT NOT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, + source_file_id BIGINT NOT NULL REFERENCES source_files(source_file_id) ON DELETE CASCADE, + source_sub_id BIGINT NOT NULL REFERENCES source_subs(source_sub_id) ON DELETE CASCADE, - UNIQUE(package) -) ROW_FORMAT=COMPRESSED; + metadata JSON DEFAULT NULL, -CREATE TABLE coverage ( - coverage_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + UNIQUE(run_id, job_try_id, test_file_id, source_file_id, source_sub_id) +); +CREATE INDEX IF NOT EXISTS coverage_from_source ON coverage(source_file_id, source_sub_id); +CREATE INDEX IF NOT EXISTS coverage_from_run_source ON coverage(run_id, source_file_id, source_sub_id); +CREATE INDEX IF NOT EXISTS coverage_from_job ON coverage(job_try_id); - run_id BINARY(16) NOT NULL, - job_key BINARY(16) DEFAULT NULL, +CREATE TABLE reporting ( + reporting_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, - test_file_idx BIGINT NOT NULL, - source_file_idx BIGINT NOT NULL, - source_sub_idx BIGINT NOT NULL, - coverage_manager_idx BIGINT DEFAULT NULL, + job_try_id BIGINT DEFAULT NULL REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + test_file_id BIGINT DEFAULT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, - metadata JSON DEFAULT NULL, + project_id BIGINT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + user_id BIGINT NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_file_idx) REFERENCES source_files(source_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_sub_idx) REFERENCES source_subs(source_sub_idx) ON DELETE CASCADE, - FOREIGN KEY (coverage_manager_idx) REFERENCES coverage_manager(coverage_manager_idx) ON DELETE CASCADE, + job_try SMALLINT DEFAULT NULL, - UNIQUE(run_id, job_key, test_file_idx, source_file_idx, source_sub_idx) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX coverage_from_source ON coverage(source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_run_source ON coverage(run_id, source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_job ON coverage(job_key); + retry SMALLINT NOT NULL, + abort SMALLINT NOT NULL, + fail SMALLINT NOT NULL, + pass SMALLINT NOT NULL, -CREATE TABLE reporting ( - reporting_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, - run_id BINARY(16) NOT NULL, - - test_file_idx BIGINT DEFAULT NULL, - job_key BINARY(16) DEFAULT NULL, - event_id BINARY(16) DEFAULT NULL, - - job_try INT DEFAULT NULL, - subtest VARCHAR(512) DEFAULT NULL, - duration DOUBLE PRECISION NOT NULL, - - fail SMALLINT NOT NULL DEFAULT 0, - pass SMALLINT NOT NULL DEFAULT 0, - retry SMALLINT NOT NULL DEFAULT 0, - abort SMALLINT NOT NULL DEFAULT 0, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE + subtest VARCHAR(512) DEFAULT NULL, + duration NUMERIC(14,4) NOT NULL ); -CREATE INDEX reporting_user ON reporting(user_idx); -CREATE INDEX reporting_run ON reporting(run_id); -CREATE INDEX reporting_a ON reporting(project_idx); -CREATE INDEX reporting_b ON reporting(project_idx, user_idx); -CREATE INDEX reporting_e ON reporting(project_idx, test_file_idx, subtest, user_idx, reporting_idx); - -CREATE TABLE resource_batch ( - resource_batch_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_id BINARY(16) NOT NULL, - host_idx BIGINT NOT NULL, - stamp TIMESTAMP(4) NOT NULL, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (host_idx) REFERENCES hosts(host_idx) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX resource_batch_run ON resource_batch(run_id); - -CREATE TABLE resources ( - resource_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - resource_batch_idx BIGINT NOT NULL, - module VARCHAR(512) NOT NULL, - data JSON NOT NULL, - - FOREIGN KEY (resource_batch_idx) REFERENCES resource_batch(resource_batch_idx) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX resources_batch_idx ON resources(resource_batch_idx); +CREATE INDEX IF NOT EXISTS reporting_run ON reporting(run_id); +CREATE INDEX IF NOT EXISTS reporting_user ON reporting(user_id); +CREATE INDEX IF NOT EXISTS reporting_a ON reporting(project_id); +CREATE INDEX IF NOT EXISTS reporting_b ON reporting(project_id, user_id); +CREATE INDEX IF NOT EXISTS reporting_e ON reporting(project_id, test_file_id, subtest, user_id, reporting_id); diff --git a/share/schema/Percona.sql b/share/schema/Percona.sql index ddc2d749b..531559f42 100644 --- a/share/schema/Percona.sql +++ b/share/schema/Percona.sql @@ -1,468 +1,470 @@ +CREATE TABLE versions( + version NUMERIC(10,6) NOT NULL, + version_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + updated TIMESTAMP NOT NULL DEFAULT now(), + + UNIQUE(version) +); + +INSERT INTO versions(version) VALUES('2.000000'); + CREATE TABLE config( - config_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - setting VARCHAR(128) NOT NULL, - value VARCHAR(256) NOT NULL, + config_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + setting VARCHAR(128) NOT NULL, + value VARCHAR(256) NOT NULL, + UNIQUE(setting) ); CREATE TABLE users ( - user_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(64) NOT NULL, - pw_hash VARCHAR(31) DEFAULT NULL, - pw_salt VARCHAR(22) DEFAULT NULL, - realname TEXT DEFAULT NULL, - role ENUM( - 'admin', -- Can add users and set permissions - 'user' -- Can manage reports for their projects - ) NOT NULL DEFAULT 'user', + user_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + pw_hash VARCHAR(31) DEFAULT NULL, + pw_salt VARCHAR(22) DEFAULT NULL, + + role ENUM('admin', 'user') + NOT NULL DEFAULT 'user', + + username VARCHAR(64) NOT NULL, + realname TEXT DEFAULT NULL, UNIQUE(username) ); CREATE TABLE email ( - email_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL, + verified BOOL NOT NULL DEFAULT FALSE, + local VARCHAR(128) NOT NULL, domain VARCHAR(128) NOT NULL, - verified BOOL NOT NULL DEFAULT FALSE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, + UNIQUE(local, domain) ); -CREATE INDEX email_user ON email(user_idx); +CREATE INDEX email_user ON email(user_id); CREATE TABLE primary_email ( - user_idx BIGINT NOT NULL PRIMARY KEY, - email_idx BIGINT NOT NULL, + user_id BIGINT NOT NULL PRIMARY KEY, + email_id BIGINT NOT NULL, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, + FOREIGN KEY (email_id) REFERENCES email(email_id) ON DELETE CASCADE, - unique(email_idx) + unique(email_id) ); CREATE TABLE hosts ( - host_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + host_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, hostname VARCHAR(512) NOT NULL, unique(hostname) ); CREATE TABLE email_verification_codes ( - email_idx BIGINT NOT NULL PRIMARY KEY, - evcode_id BINARY(16) NOT NULL, + evcode BINARY(16) NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY, - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE + FOREIGN KEY (email_id) REFERENCES email(email_id) ON DELETE CASCADE ); CREATE TABLE sessions ( - session_id BINARY(16) NOT NULL PRIMARY KEY, - active BOOL DEFAULT TRUE -) ROW_FORMAT=COMPRESSED; + session_uuid BINARY(16) NOT NULL, + session_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + active BOOL DEFAULT TRUE, + + UNIQUE(session_uuid) +); CREATE TABLE session_hosts ( - session_host_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT, - session_id BINARY(16) NOT NULL, + session_host_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + session_id BIGINT NOT NULL, + user_id BIGINT, - created TIMESTAMP NOT NULL DEFAULT now(), - accessed TIMESTAMP NOT NULL DEFAULT now(), + created TIMESTAMP NOT NULL DEFAULT now(), + accessed TIMESTAMP NOT NULL DEFAULT now(), address VARCHAR(128) NOT NULL, agent VARCHAR(128) NOT NULL, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, + FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE CASCADE, UNIQUE(address, agent, session_id) -) ROW_FORMAT=COMPRESSED; +); CREATE INDEX session_hosts_session ON session_hosts(session_id); CREATE TABLE api_keys ( - api_key_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, - name VARCHAR(128) NOT NULL, - value VARCHAR(36) NOT NULL, + value BINARY(16) NOT NULL, + api_key_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL, - status ENUM( 'active', 'disabled', 'revoked') NOT NULL, + status ENUM( 'active', 'disabled', 'revoked') + NOT NULL DEFAULT 'active', - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, + name VARCHAR(128) NOT NULL, + + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, UNIQUE(value) ); -CREATE INDEX api_key_user ON api_keys(user_idx); +CREATE INDEX api_key_user ON api_keys(user_id); CREATE TABLE log_files ( - log_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - name TEXT NOT NULL, + log_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + name TEXT NOT NULL, local_file TEXT, data LONGBLOB -) ROW_FORMAT=COMPRESSED; +); CREATE TABLE projects ( - project_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(128) NOT NULL, + project_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, owner BIGINT DEFAULT NULL, + name VARCHAR(128) NOT NULL, + + FOREIGN KEY (owner) REFERENCES users(user_id) ON DELETE SET NULL, - FOREIGN KEY (owner) REFERENCES users(user_idx) ON DELETE SET NULL, UNIQUE(name) ); CREATE TABLE permissions ( - permission_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, + permission_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + project_id BIGINT NOT NULL, + user_id BIGINT NOT NULL, updated TIMESTAMP NOT NULL DEFAULT now(), - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, + FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, - UNIQUE(project_idx, user_idx) + UNIQUE(project_id, user_id) ); -CREATE TABLE runs ( - run_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_idx BIGINT NOT NULL, - project_idx BIGINT NOT NULL, - log_file_idx BIGINT DEFAULT NULL, +CREATE TABLE syncs ( + sync_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, + last_run_id BIGINT NOT NULL, + last_project_id BIGINT NOT NULL, + last_user_id BIGINT NOT NULL, + source VARCHAR(64) NOT NULL, - run_id BINARY(16) NOT NULL, + UNIQUE(source) +); - status ENUM('pending', 'running', 'complete', 'broken', 'canceled') NOT NULL, +CREATE TABLE runs ( + run_uuid BINARY(16) NOT NULL, - worker_id VARCHAR(36) DEFAULT NULL, - error TEXT DEFAULT NULL, + run_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_id BIGINT NOT NULL, + project_id BIGINT NOT NULL, + log_file_id BIGINT DEFAULT NULL, - pinned BOOL NOT NULL DEFAULT FALSE, - has_coverage BOOL NOT NULL DEFAULT FALSE, + sync_id INTEGER DEFAULT NULL, + passed INTEGER DEFAULT NULL, + failed INTEGER DEFAULT NULL, + to_retry INTEGER DEFAULT NULL, + retried INTEGER DEFAULT NULL, + concurrency_j INTEGER DEFAULT NULL, + concurrency_x INTEGER DEFAULT NULL, + added TIMESTAMP NOT NULL DEFAULT now(), - -- User Input - added TIMESTAMP NOT NULL DEFAULT now(), - duration VARCHAR(36) DEFAULT NULL, + status ENUM('pending', 'running', 'complete', 'broken', 'canceled') + NOT NULL DEFAULT 'pending', mode ENUM('qvfds', 'qvfd', 'qvf', 'summary', 'complete') - DEFAULT 'qvfd' NOT NULL, + NOT NULL DEFAULT 'qvfd', - buffer ENUM('none', 'diag', 'job', 'run') - DEFAULT 'job' NOT NULL, + canon BOOL NOT NULL, -- Should be true if sync_id was never set + pinned BOOL NOT NULL DEFAULT FALSE, + has_coverage BOOL DEFAULT NULL, + has_resources BOOL DEFAULT NULL, - -- From Log - passed INTEGER DEFAULT NULL, - failed INTEGER DEFAULT NULL, - retried INTEGER DEFAULT NULL, - concurrency INTEGER DEFAULT NULL, + parameters JSON DEFAULT NULL, + worker_id TEXT DEFAULT NULL, + error TEXT DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (log_file_idx) REFERENCES log_files(log_file_idx) ON DELETE SET NULL, + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, + FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE CASCADE, + FOREIGN KEY (log_file_id) REFERENCES log_files(log_file_id) ON DELETE SET NULL, + FOREIGN KEY (sync_id) REFERENCES syncs(sync_id) ON DELETE SET NULL, - UNIQUE(run_id) + UNIQUE(run_uuid) ); -CREATE INDEX run_projects ON runs(project_idx); -CREATE INDEX run_status ON runs(status); -CREATE INDEX run_user ON runs(user_idx); +CREATE INDEX run_projects ON runs(project_id); +CREATE INDEX run_status ON runs(status); +CREATE INDEX run_user ON runs(user_id); +CREATE INDEX run_canon ON runs(run_id, canon); CREATE TABLE sweeps ( - sweep_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_idx BIGINT NOT NULL, - name VARCHAR(255) NOT NULL, + sweep_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL, + name VARCHAR(64) NOT NULL, - FOREIGN KEY (run_idx) REFERENCES runs(run_idx) ON DELETE CASCADE, + FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - UNIQUE(run_idx, name) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX sweep_runs ON sweeps(run_idx); + UNIQUE(run_id, name) +); +CREATE INDEX sweep_runs ON sweeps(run_id); -CREATE TABLE run_fields ( - run_field_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_field_id BINARY(16) NOT NULL, - run_id BINARY(16) NOT NULL, - name VARCHAR(255) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, +CREATE TABLE test_files ( + test_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + filename VARCHAR(255) NOT NULL, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, + UNIQUE(filename) +); - UNIQUE(run_field_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX run_fields_run_id ON run_fields(run_id); -CREATE INDEX run_fields_name ON run_fields(name); +INSERT INTO test_files(filename) VALUES('HARNESS INTERNAL LOG'); -CREATE TABLE run_parameters ( - run_parameters_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_id BINARY(16) NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - parameters JSON DEFAULT NULL, +CREATE TABLE jobs ( + job_uuid BINARY(16) NOT NULL, - UNIQUE(run_id) -) ROW_FORMAT=COMPRESSED; + job_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL, + test_file_id BIGINT NOT NULL, -CREATE TABLE test_files ( - test_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + is_harness_out BOOL NOT NULL, + failed BOOL NOT NULL, + passed BOOL DEFAULT NULL, - filename VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, + FOREIGN KEY (test_file_id) REFERENCES test_files(test_file_id) ON DELETE CASCADE, - UNIQUE(filename) -) ROW_FORMAT=COMPRESSED; + UNIQUE(job_uuid) +); +CREATE INDEX job_runs ON jobs(run_id); +CREATE INDEX job_file ON jobs(test_file_id); -CREATE TABLE jobs ( - job_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, +CREATE TABLE job_tries ( + job_try_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_id BIGINT NOT NULL, + pass_count BIGINT DEFAULT NULL, + fail_count BIGINT DEFAULT NULL, - job_key BINARY(16) NOT NULL, - job_id BINARY(16) NOT NULL, - run_id BINARY(16) NOT NULL, + exit_code INTEGER DEFAULT NULL, + launch TIMESTAMP DEFAULT NULL, + start TIMESTAMP DEFAULT NULL, + ended TIMESTAMP DEFAULT NULL, - test_file_idx BIGINT DEFAULT NULL, - job_try INT NOT NULL DEFAULT 0, status ENUM('pending', 'running', 'complete', 'broken', 'canceled') - NOT NULL DEFAULT 'pending', - - is_harness_out BOOL NOT NULL DEFAULT FALSE, + NOT NULL DEFAULT 'pending', - -- Summaries - fail BOOL DEFAULT NULL, - retry BOOL DEFAULT NULL, - name TEXT DEFAULT NULL, - exit_code INT DEFAULT NULL, - launch TIMESTAMP DEFAULT NULL, - start TIMESTAMP DEFAULT NULL, - ended TIMESTAMP DEFAULT NULL, + job_try_ord SMALLINT NOT NULL, - duration DOUBLE PRECISION DEFAULT NULL, + fail BOOL DEFAULT NULL, + retry BOOL DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - pass_count BIGINT DEFAULT NULL, - fail_count BIGINT DEFAULT NULL, + parameters JSON DEFAULT NULL, + stdout TEXT DEFAULT NULL, + stderr TEXT DEFAULT NULL, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, + FOREIGN KEY (job_id) REFERENCES jobs(job_id) ON DELETE CASCADE, - UNIQUE(job_key), - UNIQUE(job_id, job_try) + UNIQUE(job_try_id, job_try_ord) ); -CREATE INDEX job_runs ON jobs(run_id); -CREATE INDEX job_fail ON jobs(fail); -CREATE INDEX job_file ON jobs(test_file_idx); +CREATE INDEX job_try_fail ON job_tries(fail); +CREATE INDEX job_try_job_fail ON job_tries(job_id, fail); -CREATE TABLE job_parameters ( - job_parameters_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_key BINARY(16) NOT NULL REFERENCES jobs(job_key) ON DELETE CASCADE, - parameters JSON DEFAULT NULL, +CREATE TABLE events ( + event_uuid BINARY(16) NOT NULL, + trace_uuid BINARY(16) DEFAULT NULL, + parent_uuid BINARY(16) DEFAULT NULL, - UNIQUE(job_key) -) ROW_FORMAT=COMPRESSED; + event_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_try_id BIGINT NOT NULL, + parent_id BIGINT DEFAULT NULL, -CREATE TABLE job_outputs ( - job_output_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_key BINARY(16) NOT NULL, + event_idx INTEGER NOT NULL, -- Line number from log, or event number from stream + event_sdx INTEGER NOT NULL, -- Event sequence number from the line (IE parent + subtest events) + stamp TIMESTAMP DEFAULT NULL, - stream ENUM('STDOUT', 'STDERR') - NOT NULL, + nested SMALLINT NOT NULL, - output TEXT NOT NULL, + is_subtest BOOL NOT NULL, + is_diag BOOL NOT NULL, + is_harness BOOL NOT NULL, + is_time BOOL NOT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + causes_fail BOOL NOT NULL, - UNIQUE(job_key, stream) -); + has_facets BOOL NOT NULL, + has_orphan BOOL NOT NULL, + has_binary BOOL NOT NULL, -CREATE TABLE job_fields ( - job_field_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - job_field_id BINARY(16) NOT NULL, - job_key BINARY(16) NOT NULL, - name VARCHAR(512) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, + facets JSON DEFAULT NULL, + orphan JSON DEFAULT NULL, + rendered JSON DEFAULT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + FOREIGN KEY (parent_uuid) REFERENCES events(event_uuid), + FOREIGN KEY (job_try_id) REFERENCES job_tries(job_try_id) ON DELETE CASCADE, + FOREIGN KEY (parent_id) REFERENCES events(event_id) ON DELETE CASCADE, - UNIQUE(job_field_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX job_fields_job_key ON job_fields(job_key); -CREATE INDEX job_fields_name ON job_fields(name); - -CREATE TABLE events ( - event_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - event_id BINARY(16) NOT NULL, + UNIQUE(job_try_id, event_idx, event_sdx), + UNIQUE(event_uuid) +); +CREATE INDEX event_parent ON events(parent_id); +CREATE INDEX event_job_ts ON events(job_try_id, stamp); +CREATE INDEX event_job_st ON events(job_try_id, is_subtest); - job_key BINARY(16) NOT NULL, +CREATE TABLE binaries ( + event_uuid BINARY(16) NOT NULL, - is_subtest BOOL NOT NULL, - is_diag BOOL NOT NULL, - is_harness BOOL NOT NULL, - is_time BOOL NOT NULL, - is_assert BOOL NOT NULL, + binary_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + event_id BIGINT DEFAULT NULL, - causes_fail BOOL NOT NULL, + is_image BOOL NOT NULL DEFAULT FALSE, - has_binary BOOL NOT NULL, - has_facets BOOL NOT NULL, - has_orphan BOOL NOT NULL, + filename VARCHAR(512) NOT NULL, + description TEXT DEFAULT NULL, + data LONGBLOB NOT NULL, - stamp TIMESTAMP DEFAULT NULL, + FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE +); +CREATE INDEX binaries_event ON binaries(event_id); - parent_id BINARY(16) DEFAULT NULL, - trace_id VARCHAR(36) DEFAULT NULL, - nested INT NOT NULL DEFAULT 0, +CREATE TABLE run_fields ( + event_uuid BINARY(16) NOT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - -- FOREIGN KEY (parent_id) REFERENCES events(event_id), + run_field_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + run_id BIGINT NOT NULL, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX event_job_ts ON events(job_key, stamp); -CREATE INDEX event_job_st ON events(job_key, is_subtest); -CREATE INDEX event_trace ON events(trace_id); -CREATE INDEX event_parent ON events(parent_id); + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL, -CREATE TABLE renders ( - event_id BINARY(16) NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, + FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE +); +CREATE INDEX run_fields_run_id ON run_fields(run_id); +CREATE INDEX run_fields_name ON run_fields(name); - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, +CREATE TABLE job_try_fields ( + event_uuid BINARY(16) NOT NULL, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; + job_field_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_try_id BIGINT NOT NULL, -CREATE TABLE facets ( - event_id BINARY(16) NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + FOREIGN KEY (job_try_id) REFERENCES job_tries(job_try_id) ON DELETE CASCADE +); +CREATE INDEX job_try_fields_job_id ON job_try_fields(job_try_id); +CREATE INDEX job_try_fields_name ON job_try_fields(name); - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; +CREATE TABLE source_files ( + source_file_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + filename VARCHAR(512) NOT NULL, -CREATE TABLE orphans ( - event_id BINARY(16) NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, + UNIQUE(filename) +); - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, +CREATE TABLE source_subs ( + source_sub_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + subname VARCHAR(512) NOT NULL, - UNIQUE(event_id) -) ROW_FORMAT=COMPRESSED; + UNIQUE(subname) +); -CREATE TABLE binaries ( - binary_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - event_id BINARY(16) NOT NULL, - filename VARCHAR(512) NOT NULL, - description TEXT DEFAULT NULL, - is_image BOOL NOT NULL DEFAULT FALSE, - data LONGBLOB NOT NULL, +CREATE TABLE resource_types( + resource_type_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(512) NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX binaries_event ON binaries(event_id); + UNIQUE(name) +); -CREATE TABLE source_files ( - source_file_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, +CREATE TABLE resources ( + event_uuid BINARY(16) NOT NULL, - filename VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + resource_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + resource_type_id BIGINT NOT NULL, + run_id BIGINT NOT NULL, + host_id BIGINT, - UNIQUE(filename) -) ROW_FORMAT=COMPRESSED; + stamp TIMESTAMP NOT NULL, + resource_ord INTEGER NOT NULL, -CREATE TABLE source_subs ( - source_sub_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + data JSON NOT NULL, - subname VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + FOREIGN KEY (resource_type_id) REFERENCES resource_types(resource_type_id) ON DELETE CASCADE, + FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, + FOREIGN KEY (host_id) REFERENCES hosts(host_id) ON DELETE SET NULL, - UNIQUE(subname) -) ROW_FORMAT=COMPRESSED; + UNIQUE(run_id, resource_ord) +); +CREATE INDEX res_data_runs ON resources(run_id); +CREATE INDEX res_data_res ON resources(resource_type_id); +CREATE INDEX res_data_runs_and_res ON resources(run_id, resource_type_id); CREATE TABLE coverage_manager ( - coverage_manager_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - package VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_bin - NOT NULL, + coverage_manager_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + package VARCHAR(256) NOT NULL, UNIQUE(package) -) ROW_FORMAT=COMPRESSED; +); CREATE TABLE coverage ( - coverage_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, + event_uuid BINARY(16) NOT NULL, - run_id BINARY(16) NOT NULL, - job_key BINARY(16) DEFAULT NULL, + coverage_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, - test_file_idx BIGINT NOT NULL, - source_file_idx BIGINT NOT NULL, - source_sub_idx BIGINT NOT NULL, - coverage_manager_idx BIGINT DEFAULT NULL, + job_try_id BIGINT DEFAULT NULL, + coverage_manager_id BIGINT DEFAULT NULL, + + run_id BIGINT NOT NULL, + test_file_id BIGINT NOT NULL, + source_file_id BIGINT NOT NULL, + source_sub_id BIGINT NOT NULL, metadata JSON DEFAULT NULL, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_file_idx) REFERENCES source_files(source_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_sub_idx) REFERENCES source_subs(source_sub_idx) ON DELETE CASCADE, - FOREIGN KEY (coverage_manager_idx) REFERENCES coverage_manager(coverage_manager_idx) ON DELETE CASCADE, + FOREIGN KEY (job_try_id) REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + FOREIGN KEY (coverage_manager_id) REFERENCES coverage_manager(coverage_manager_id) ON DELETE CASCADE, + FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, + FOREIGN KEY (test_file_id) REFERENCES test_files(test_file_id) ON DELETE CASCADE, + FOREIGN KEY (source_file_id) REFERENCES source_files(source_file_id) ON DELETE CASCADE, + FOREIGN KEY (source_sub_id) REFERENCES source_subs(source_sub_id) ON DELETE CASCADE, - UNIQUE(run_id, job_key, test_file_idx, source_file_idx, source_sub_idx) -) ROW_FORMAT=COMPRESSED; -CREATE INDEX coverage_from_source ON coverage(source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_run_source ON coverage(run_id, source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_job ON coverage(job_key); + UNIQUE(run_id, job_try_id, test_file_id, source_file_id, source_sub_id) +); +CREATE INDEX coverage_from_source ON coverage(source_file_id, source_sub_id); +CREATE INDEX coverage_from_run_source ON coverage(run_id, source_file_id, source_sub_id); +CREATE INDEX coverage_from_job ON coverage(job_try_id); CREATE TABLE reporting ( - reporting_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, - run_id BINARY(16) NOT NULL, - - test_file_idx BIGINT DEFAULT NULL, - job_key BINARY(16) DEFAULT NULL, - event_id BINARY(16) DEFAULT NULL, - - job_try INT DEFAULT NULL, - subtest VARCHAR(512) DEFAULT NULL, - duration DOUBLE PRECISION NOT NULL, - - fail SMALLINT NOT NULL DEFAULT 0, - pass SMALLINT NOT NULL DEFAULT 0, - retry SMALLINT NOT NULL DEFAULT 0, - abort SMALLINT NOT NULL DEFAULT 0, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE + reporting_id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, + + job_try_id BIGINT DEFAULT NULL, + test_file_id BIGINT DEFAULT NULL, + + project_id BIGINT NOT NULL, + user_id BIGINT NOT NULL, + run_id BIGINT NOT NULL, + + job_try SMALLINT DEFAULT NULL, + + retry SMALLINT NOT NULL, + abort SMALLINT NOT NULL, + fail SMALLINT NOT NULL, + pass SMALLINT NOT NULL, + + subtest VARCHAR(512) DEFAULT NULL, + duration NUMERIC(14,4) NOT NULL, + + FOREIGN KEY (job_try_id) REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + FOREIGN KEY (test_file_id) REFERENCES test_files(test_file_id) ON DELETE CASCADE, + FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE CASCADE, + FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE, + FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE ); -CREATE INDEX reporting_user ON reporting(user_idx); CREATE INDEX reporting_run ON reporting(run_id); -CREATE INDEX reporting_a ON reporting(project_idx); -CREATE INDEX reporting_b ON reporting(project_idx, user_idx); -CREATE INDEX reporting_e ON reporting(project_idx, test_file_idx, subtest, user_idx, reporting_idx); - -CREATE TABLE resource_batch ( - resource_batch_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - run_id BINARY(16) NOT NULL, - host_idx BIGINT NOT NULL, - stamp TIMESTAMP(4) NOT NULL, +CREATE INDEX reporting_user ON reporting(user_id); +CREATE INDEX reporting_a ON reporting(project_id); +CREATE INDEX reporting_b ON reporting(project_id, user_id); +CREATE INDEX reporting_e ON reporting(project_id, test_file_id, subtest, user_id, reporting_id); - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (host_idx) REFERENCES hosts(host_idx) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX resource_batch_run ON resource_batch(run_id); -CREATE TABLE resources ( - resource_idx BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, - resource_batch_idx BIGINT NOT NULL, - module VARCHAR(512) NOT NULL, - data JSON NOT NULL, - - FOREIGN KEY (resource_batch_idx) REFERENCES resource_batch(resource_batch_idx) ON DELETE CASCADE -) ROW_FORMAT=COMPRESSED; -CREATE INDEX resources_batch_idx ON resources(resource_batch_idx); diff --git a/share/schema/PostgreSQL.sql b/share/schema/PostgreSQL.sql index 2e872ae02..641cc438e 100644 --- a/share/schema/PostgreSQL.sql +++ b/share/schema/PostgreSQL.sql @@ -30,7 +30,7 @@ CREATE TYPE user_type AS ENUM( CREATE TABLE versions( version NUMERIC(10,6) NOT NULL, - version_id SERIAL PRIMARY KEY, + version_id SERIAL NOT NULL PRIMARY KEY, updated TIMESTAMP NOT NULL DEFAULT now(), UNIQUE(version) @@ -39,7 +39,7 @@ CREATE TABLE versions( INSERT INTO versions(version) VALUES('2.000000'); CREATE TABLE config( - config_id SERIAL PRIMARY KEY, + config_id SERIAL NOT NULL PRIMARY KEY, setting VARCHAR(128) NOT NULL, value VARCHAR(256) NOT NULL, @@ -278,7 +278,7 @@ CREATE TABLE events ( has_facets BOOL NOT NULL, has_orphan BOOL NOT NULL, - has_binaries BOOL NOT NULL, + has_binary BOOL NOT NULL, facets JSONB DEFAULT NULL, orphan JSONB DEFAULT NULL, @@ -359,10 +359,10 @@ CREATE TABLE resource_types( CREATE TABLE resources ( event_uuid UUID NOT NULL, - resource_id BIGSERIAL NOT NULL PRIMARY KEY, - resource_type_id BIGINT NOT NULL REFERENCES resource_types(resource_type_id) ON DELETE CASCADE, - run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - host_id BIGINT NOT NULL REFERENCES hosts(host_id) ON DELETE SET NULL, + resource_id BIGSERIAL NOT NULL PRIMARY KEY, + resource_type_id BIGINT NOT NULL REFERENCES resource_types(resource_type_id) ON DELETE CASCADE, + run_id BIGINT NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + host_id BIGINT REFERENCES hosts(host_id) ON DELETE SET NULL, stamp TIMESTAMP NOT NULL, resource_ord INTEGER NOT NULL, diff --git a/share/schema/SQLite.sql b/share/schema/SQLite.sql index bda55a81f..6533ab304 100644 --- a/share/schema/SQLite.sql +++ b/share/schema/SQLite.sql @@ -1,467 +1,412 @@ +CREATE TABLE versions( + version_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + version NUMERIC(10,6) NOT NULL, + updated TIMESTAMP NOT NULL DEFAULT now, + + UNIQUE(version) +); + +INSERT INTO versions(version) VALUES('2.000000'); + CREATE TABLE config( - config_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - setting VARCHAR(128) NOT NULL, - value VARCHAR(256) NOT NULL, + config_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + setting VARCHAR(128) NOT NULL, + value VARCHAR(256) NOT NULL, + UNIQUE(setting) ); CREATE TABLE users ( - user_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - username VARCHAR(64) NOT NULL, - pw_hash VARCHAR(31) DEFAULT NULL, - pw_salt VARCHAR(22) DEFAULT NULL, - realname TEXT DEFAULT NULL, + user_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + pw_hash VARCHAR(31) DEFAULT NULL, + pw_salt VARCHAR(22) DEFAULT NULL, role TEXT CHECK(role IN ( 'admin', -- Can add users and set permissions 'user' -- Can manage reports for their projects )) NOT NULL DEFAULT 'user', + username VARCHAR(64) NOT NULL, + realname TEXT DEFAULT NULL, + UNIQUE(username) ); CREATE TABLE email ( - email_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - user_idx BIGINT NOT NULL, + email_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + verified BOOL NOT NULL DEFAULT FALSE, + local VARCHAR(128) NOT NULL, domain VARCHAR(128) NOT NULL, - verified BOOL NOT NULL DEFAULT FALSE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, UNIQUE(local, domain) ); -CREATE INDEX email_user ON email(user_idx); +CREATE INDEX IF NOT EXISTS email_user ON email(user_id); CREATE TABLE primary_email ( - user_idx BIGINT NOT NULL PRIMARY KEY, - email_idx BIGINT NOT NULL, + user_id BIGINT NOT NULL PRIMARY KEY REFERENCES users(user_id) ON DELETE CASCADE, + email_id BIGINT NOT NULL REFERENCES email(email_id) ON DELETE CASCADE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE, - - unique(email_idx) + unique(email_id) ); CREATE TABLE hosts ( - host_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + host_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, hostname VARCHAR(512) NOT NULL, unique(hostname) ); CREATE TABLE email_verification_codes ( - email_idx BIGINT NOT NULL PRIMARY KEY, - evcode_id UUID NOT NULL, - - FOREIGN KEY (email_idx) REFERENCES email(email_idx) ON DELETE CASCADE + evcode UUID NOT NULL, + email_id BIGINT NOT NULL PRIMARY KEY REFERENCES email(email_id) ON DELETE CASCADE ); CREATE TABLE sessions ( - session_id UUID NOT NULL PRIMARY KEY, - active BOOL DEFAULT TRUE + session_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + session_uuid UUID NOT NULL, + active BOOL DEFAULT TRUE, + + UNIQUE(session_uuid) ); CREATE TABLE session_hosts ( - session_host_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - user_idx BIGINT, - session_id UUID NOT NULL, + session_host_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + user_id INTEGER REFERENCES users(user_id) ON DELETE CASCADE, + session_id INTEGER NOT NULL REFERENCES sessions(session_id) ON DELETE CASCADE, - created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - accessed TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + created TIMESTAMP NOT NULL DEFAULT now, + accessed TIMESTAMP NOT NULL DEFAULT now, - address VARCHAR(128) NOT NULL, - agent TEXT NOT NULL, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (session_id) REFERENCES sessions(session_id) ON DELETE CASCADE, + address TEXT NOT NULL, + agent TEXT NOT NULL, UNIQUE(address, agent, session_id) ); -CREATE INDEX session_hosts_session ON session_hosts(session_id); +CREATE INDEX IF NOT EXISTS session_hosts_session ON session_hosts(session_id); CREATE TABLE api_keys ( - api_key_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - user_idx BIGINT NOT NULL, - name VARCHAR(128) NOT NULL, - value VARCHAR(36) NOT NULL, + api_key_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + value UUID NOT NULL, + user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, - status TEXT CHECK(status IN ('active', 'disabled', 'revoked')) NOT NULL, + status TEXT NOT NULL CHECK(status IN ('active', 'disabled', 'revoked')), - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, + name VARCHAR(128) NOT NULL, UNIQUE(value) ); -CREATE INDEX api_key_user ON api_keys(user_idx); +CREATE INDEX IF NOT EXISTS api_key_user ON api_keys(user_id); CREATE TABLE log_files ( - log_file_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - name TEXT NOT NULL, + log_file_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, local_file TEXT, data LONGBLOB ); CREATE TABLE projects ( - project_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + project_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + owner INTEGER DEFAULT NULL REFERENCES users(user_id) ON DELETE SET NULL, name VARCHAR(128) NOT NULL, - owner BIGINT DEFAULT NULL, - FOREIGN KEY (owner) REFERENCES users(user_idx) ON DELETE SET NULL, UNIQUE(name) ); CREATE TABLE permissions ( - permission_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, - updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, + permission_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + project_id INTEGER NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + updated TIMESTAMP NOT NULL DEFAULT now, - UNIQUE(project_idx, user_idx) + UNIQUE(project_id, user_id) ); -CREATE TABLE runs ( - run_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - user_idx BIGINT NOT NULL, - project_idx BIGINT NOT NULL, - log_file_idx BIGINT DEFAULT NULL, - - run_id UUID NOT NULL, - - status TEXT CHECK(status IN ('pending', 'running', 'complete', 'broken', 'canceled')) NOT NULL, - - worker_id VARCHAR(36) DEFAULT NULL, - error TEXT DEFAULT NULL, - - pinned BOOL NOT NULL DEFAULT FALSE, - has_coverage BOOL NOT NULL DEFAULT FALSE, - - -- User Input - added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - duration VARCHAR(36) DEFAULT NULL, +CREATE TABLE syncs ( + sync_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + last_run_id INTEGER NOT NULL, + last_project_id INTEGER NOT NULL, + last_user_id INTEGER NOT NULL, + source VARCHAR(64) NOT NULL, + UNIQUE(source) +); - mode TEXT CHECK(mode IN ('qvfds', 'qvfd', 'qvf', 'summary', 'complete')) - DEFAULT 'qvfd' NOT NULL, +CREATE TABLE runs ( + run_uuid UUID NOT NULL, - buffer TEXT CHECK(buffer IN ('none', 'diag', 'job', 'run')) - DEFAULT 'job' NOT NULL, + run_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + project_id INTEGER NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + log_file_id INTEGER DEFAULT NULL REFERENCES log_files(log_file_id) ON DELETE SET NULL, - -- From Log + sync_id INTEGER DEFAULT NULL REFERENCES syncs(sync_id) ON DELETE SET NULL, passed INTEGER DEFAULT NULL, failed INTEGER DEFAULT NULL, + to_retry INTEGER DEFAULT NULL, retried INTEGER DEFAULT NULL, - concurrency INTEGER DEFAULT NULL, - - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (log_file_idx) REFERENCES log_files(log_file_idx) ON DELETE SET NULL, + concurrency_j INTEGER DEFAULT NULL, + concurrency_x INTEGER DEFAULT NULL, + added TIMESTAMP NOT NULL DEFAULT now, - UNIQUE(run_id) -); -CREATE INDEX run_projects ON runs(project_idx); -CREATE INDEX run_status ON runs(status); -CREATE INDEX run_user ON runs(user_idx); - -CREATE TABLE sweeps ( - sweep_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - run_idx BIGINT NOT NULL, - name VARCHAR(255) NOT NULL, + status TEXT CHECK(status IN ('pending', 'running', 'complete', 'broken', 'canceled')) + DEFAULT 'pending' NOT NULL, - FOREIGN KEY (run_idx) REFERENCES runs(run_idx) ON DELETE CASCADE, + mode TEXT CHECK(mode IN ('qvfds', 'qvfd', 'qvf', 'summary', 'complete')) + DEFAULT 'qvfd' NOT NULL, - UNIQUE(run_idx, name) -); -CREATE INDEX sweep_runs ON sweeps(run_idx); + canon BOOL NOT NULL, -- Should be true if sync_id was never set + pinned BOOL NOT NULL DEFAULT FALSE, + has_coverage BOOL DEFAULT NULL, + has_resources BOOL DEFAULT NULL, -CREATE TABLE run_fields ( - run_field_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - run_field_id UUID NOT NULL, - run_id UUID NOT NULL, - name VARCHAR(255) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, + parameters JSON DEFAULT NULL, + worker_id TEXT DEFAULT NULL, + error TEXT DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - UNIQUE(run_field_id) + UNIQUE(run_uuid) ); -CREATE INDEX run_fields_run_id ON run_fields(run_id); -CREATE INDEX run_fields_name ON run_fields(name); +CREATE INDEX IF NOT EXISTS run_projects ON runs(project_id); +CREATE INDEX IF NOT EXISTS run_status ON runs(status); +CREATE INDEX IF NOT EXISTS run_user ON runs(user_id); +CREATE INDEX IF NOT EXISTS run_canon ON runs(run_id, canon); -CREATE TABLE run_parameters ( - run_parameters_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - run_id UUID NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - parameters JSON DEFAULT NULL, +CREATE TABLE sweeps ( + sweep_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + run_id INTEGER NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + name VARCHAR(64) NOT NULL, - UNIQUE(run_id) + UNIQUE(run_id, name) ); +CREATE INDEX IF NOT EXISTS sweep_runs ON sweeps(run_id); CREATE TABLE test_files ( - test_file_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - - filename VARCHAR(512) NOT NULL, + test_file_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + filename VARCHAR(255) NOT NULL, UNIQUE(filename) ); +INSERT INTO test_files(filename) VALUES('HARNESS INTERNAL LOG'); + CREATE TABLE jobs ( - job_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + job_uuid UUID NOT NULL, - job_key UUID NOT NULL, - job_id UUID NOT NULL, - run_id UUID NOT NULL, + job_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + run_id INTEGER NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + test_file_id INTEGER NOT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, - test_file_idx BIGINT DEFAULT NULL, + is_harness_out BOOL NOT NULL, + failed BOOL NOT NULL, + passed BOOL DEFAULT NULL, - job_try INT NOT NULL DEFAULT 0, + UNIQUE(job_uuid) +); +CREATE INDEX IF NOT EXISTS job_runs ON jobs(run_id); +CREATE INDEX IF NOT EXISTS job_file ON jobs(test_file_id); - status TEXT CHECK(status IN ('pending', 'running', 'complete', 'broken', 'canceled')) - DEFAULT 'pending' NOT NULL, +CREATE TABLE job_tries ( + job_try_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + job_id INTEGER NOT NULL REFERENCES jobs(job_id) ON DELETE CASCADE, + pass_count INTEGER DEFAULT NULL, + fail_count INTEGER DEFAULT NULL, - is_harness_out BOOL NOT NULL DEFAULT FALSE, + exit_code INTEGER DEFAULT NULL, + launch TIMESTAMP DEFAULT NULL, + start TIMESTAMP DEFAULT NULL, + ended TIMESTAMP DEFAULT NULL, - -- Summaries - fail BOOL DEFAULT NULL, - retry BOOL DEFAULT NULL, - name TEXT DEFAULT NULL, - exit_code INT DEFAULT NULL, - launch TIMESTAMP DEFAULT NULL, - start TIMESTAMP DEFAULT NULL, - ended TIMESTAMP DEFAULT NULL, + status TEXT CHECK(status IN ('pending', 'running', 'complete', 'broken', 'canceled')) + DEFAULT 'pending' NOT NULL, - duration DOUBLE PRECISION DEFAULT NULL, + job_try_ord SMALLINTEGER NOT NULL, - pass_count BIGINT DEFAULT NULL, - fail_count BIGINT DEFAULT NULL, + fail BOOL DEFAULT NULL, + retry BOOL DEFAULT NULL, + duration NUMERIC(14,4) DEFAULT NULL, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, + parameters JSON DEFAULT NULL, + stdout TEXT DEFAULT NULL, + stderr TEXT DEFAULT NULL, - UNIQUE(job_key), - UNIQUE(job_id, job_try) + UNIQUE(job_try_id, job_try_ord) ); -CREATE INDEX job_runs ON jobs(run_id); -CREATE INDEX job_fail ON jobs(fail); -CREATE INDEX job_file ON jobs(test_file_idx); - -CREATE TABLE job_parameters ( - job_parameters_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - job_key UUID NOT NULL REFERENCES jobs(job_key) ON DELETE CASCADE, - parameters JSON DEFAULT NULL, +CREATE INDEX IF NOT EXISTS job_try_fail ON job_tries(fail); +CREATE INDEX IF NOT EXISTS job_try_job_fail ON job_tries(job_id, fail); - UNIQUE(job_key) -); +CREATE TABLE events ( + event_uuid UUID NOT NULL, + trace_uuid UUID DEFAULT NULL, + parent_uuid UUID DEFAULT NULL REFERENCES events(event_uuid), -CREATE TABLE job_outputs ( - job_output_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - job_key UUID NOT NULL, + event_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + job_try_id INTEGER NOT NULL REFERENCES job_tries(job_try_id) ON DELETE CASCADE, + parent_id INTEGER DEFAULT NULL REFERENCES events(event_id) ON DELETE CASCADE, - stream TEXT CHECK(stream IN ('STDOUT', 'STDERR')) - NOT NULL, + event_idx INTEGER NOT NULL, -- Line number from log, or event number from stream + event_sdx INTEGER NOT NULL, -- Event sequence number from the line (IE parent + subtest events) + stamp TIMESTAMP DEFAULT NULL, - output TEXT NOT NULL, + nested SMALLINTEGERNOT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + is_subtest BOOL NOT NULL, + is_diag BOOL NOT NULL, + is_harness BOOL NOT NULL, + is_time BOOL NOT NULL, - UNIQUE(job_key, stream) -); + causes_fail BOOL NOT NULL, -CREATE TABLE job_fields ( - job_field_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - job_field_id UUID NOT NULL, - job_key UUID NOT NULL, - name VARCHAR(512) NOT NULL, - data JSON DEFAULT NULL, - details TEXT DEFAULT NULL, - raw TEXT DEFAULT NULL, - link TEXT DEFAULT NULL, + has_facets BOOL NOT NULL, + has_orphan BOOL NOT NULL, + has_binary BOOL NOT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, + facets JSON DEFAULT NULL, + orphan JSON DEFAULT NULL, + rendered JSON DEFAULT NULL, - UNIQUE(job_field_id) + UNIQUE(job_try_id, event_idx, event_sdx), + UNIQUE(event_uuid) ); -CREATE INDEX job_fields_job_key ON job_fields(job_key); -CREATE INDEX job_fields_name ON job_fields(name); - -CREATE TABLE events ( - event_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - event_id UUID NOT NULL, - - job_key UUID NOT NULL, +CREATE INDEX IF NOT EXISTS event_parent ON events(parent_id); +CREATE INDEX IF NOT EXISTS event_job_ts ON events(job_try_id, stamp); +CREATE INDEX IF NOT EXISTS event_job_st ON events(job_try_id, is_subtest); - is_subtest BOOL NOT NULL, - is_diag BOOL NOT NULL, - is_harness BOOL NOT NULL, - is_time BOOL NOT NULL, - is_assert BOOL NOT NULL, +CREATE TABLE binaries ( + event_uuid UUID NOT NULL, - causes_fail BOOL NOT NULL, + binary_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + event_id INTEGER DEFAULT NULL REFERENCES events(event_id) ON DELETE CASCADE, - has_binary BOOL NOT NULL, - has_facets BOOL NOT NULL, - has_orphan BOOL NOT NULL, + is_image BOOL NOT NULL DEFAULT FALSE, - stamp TIMESTAMP DEFAULT NULL, + filename VARCHAR(512) NOT NULL, + description TEXT DEFAULT NULL, + data LONGBLOB NOT NULL +); +CREATE INDEX IF NOT EXISTS binaries_event ON binaries(event_id); - parent_id UUID DEFAULT NULL, - trace_id UUID DEFAULT NULL, - nested INT NOT NULL DEFAULT 0, +CREATE TABLE run_fields ( + event_uuid UUID NOT NULL, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - -- FOREIGN KEY (parent_id) REFERENCES events(event_id), + run_field_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + run_id INTEGER NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, - UNIQUE(event_id) + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL ); -CREATE INDEX event_job_ts ON events(job_key, stamp); -CREATE INDEX event_job_st ON events(job_key, is_subtest); -CREATE INDEX event_trace ON events(trace_id); -CREATE INDEX event_parent ON events(parent_id); +CREATE INDEX IF NOT EXISTS run_fields_run_id ON run_fields(run_id); +CREATE INDEX IF NOT EXISTS run_fields_name ON run_fields(name); -CREATE TABLE renders ( - event_id UUID NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, +CREATE TABLE job_try_fields ( + event_uuid UUID NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, + job_field_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + job_try_id INTEGER NOT NULL REFERENCES job_tries(job_try_id) ON DELETE CASCADE, - UNIQUE(event_id) + name VARCHAR(64) NOT NULL, + data JSON DEFAULT NULL, + details TEXT DEFAULT NULL, + raw TEXT DEFAULT NULL, + link TEXT DEFAULT NULL ); +CREATE INDEX IF NOT EXISTS job_try_fields_job_id ON job_try_fields(job_try_id); +CREATE INDEX IF NOT EXISTS job_try_fields_name ON job_try_fields(name); -CREATE TABLE facets ( - event_id UUID NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, - - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, +CREATE TABLE source_files ( + source_file_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + filename VARCHAR(512) NOT NULL, - UNIQUE(event_id) + UNIQUE(filename) ); -CREATE TABLE orphans ( - event_id UUID NOT NULL PRIMARY KEY, - data JSON DEFAULT NULL, - line BIGINT DEFAULT NULL, - - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, +CREATE TABLE source_subs ( + source_sub_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + subname VARCHAR(512) NOT NULL, - UNIQUE(event_id) + UNIQUE(subname) ); -CREATE TABLE binaries ( - binary_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - event_id UUID NOT NULL, - filename VARCHAR(512) NOT NULL, - description TEXT DEFAULT NULL, - is_image BOOL NOT NULL DEFAULT FALSE, - data LONGBLOB NOT NULL, +CREATE TABLE resource_types( + resource_type_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + name VARCHAR(512) NOT NULL, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE + UNIQUE(name) ); -CREATE INDEX binaries_event ON binaries(event_id); -CREATE TABLE source_files ( - source_file_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, +CREATE TABLE resources ( + event_uuid UUID NOT NULL, - filename VARCHAR(512) NOT NULL, + resource_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + resource_type_id INTEGER NOT NULL REFERENCES resource_types(resource_type_id) ON DELETE CASCADE, + run_id INTEGER NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + host_id INTEGER REFERENCES hosts(host_id) ON DELETE SET NULL, - UNIQUE(filename) -); + stamp TIMESTAMP NOT NULL, + resource_ord INTEGER NOT NULL, -CREATE TABLE source_subs ( - source_sub_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - - subname VARCHAR(512) NOT NULL, + data JSON NOT NULL, - UNIQUE(subname) + UNIQUE(run_id, resource_ord) ); +CREATE INDEX IF NOT EXISTS res_data_runs ON resources(run_id); +CREATE INDEX IF NOT EXISTS res_data_res ON resources(resource_type_id); +CREATE INDEX IF NOT EXISTS res_data_runs_and_res ON resources(run_id, resource_type_id); CREATE TABLE coverage_manager ( - coverage_manager_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - + coverage_manager_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, package VARCHAR(256) NOT NULL, UNIQUE(package) ); CREATE TABLE coverage ( - coverage_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + event_uuid UUID NOT NULL, - run_id UUID NOT NULL, - job_key UUID DEFAULT NULL, + coverage_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - test_file_idx BIGINT NOT NULL, - source_file_idx BIGINT NOT NULL, - source_sub_idx BIGINT NOT NULL, - coverage_manager_idx BIGINT DEFAULT NULL, + job_try_id INTEGER DEFAULT NULL REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + coverage_manager_id INTEGER DEFAULT NULL REFERENCES coverage_manager(coverage_manager_id) ON DELETE CASCADE, - metadata JSON DEFAULT NULL, + run_id INTEGER NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + test_file_id INTEGER NOT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, + source_file_id INTEGER NOT NULL REFERENCES source_files(source_file_id) ON DELETE CASCADE, + source_sub_id INTEGER NOT NULL REFERENCES source_subs(source_sub_id) ON DELETE CASCADE, - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_file_idx) REFERENCES source_files(source_file_idx) ON DELETE CASCADE, - FOREIGN KEY (source_sub_idx) REFERENCES source_subs(source_sub_idx) ON DELETE CASCADE, - FOREIGN KEY (coverage_manager_idx) REFERENCES coverage_manager(coverage_manager_idx) ON DELETE CASCADE, + metadata JSON DEFAULT NULL, - UNIQUE(run_id, job_key, test_file_idx, source_file_idx, source_sub_idx) + UNIQUE(run_id, job_try_id, test_file_id, source_file_id, source_sub_id) ); -CREATE INDEX coverage_from_source ON coverage(source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_run_source ON coverage(run_id, source_file_idx, source_sub_idx); -CREATE INDEX coverage_from_job ON coverage(job_key); +CREATE INDEX IF NOT EXISTS coverage_from_source ON coverage(source_file_id, source_sub_id); +CREATE INDEX IF NOT EXISTS coverage_from_run_source ON coverage(run_id, source_file_id, source_sub_id); +CREATE INDEX IF NOT EXISTS coverage_from_job ON coverage(job_try_id); CREATE TABLE reporting ( - reporting_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - - project_idx BIGINT NOT NULL, - user_idx BIGINT NOT NULL, - run_id UUID NOT NULL, - - test_file_idx BIGINT DEFAULT NULL, - job_key UUID DEFAULT NULL, - event_id UUID DEFAULT NULL, - - job_try INT DEFAULT NULL, - subtest VARCHAR(512) DEFAULT NULL, - duration DOUBLE PRECISION NOT NULL, - - fail SMALLINT NOT NULL DEFAULT 0, - pass SMALLINT NOT NULL DEFAULT 0, - retry SMALLINT NOT NULL DEFAULT 0, - abort SMALLINT NOT NULL DEFAULT 0, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (job_key) REFERENCES jobs(job_key) ON DELETE CASCADE, - FOREIGN KEY (event_id) REFERENCES events(event_id) ON DELETE CASCADE, - FOREIGN KEY (project_idx) REFERENCES projects(project_idx) ON DELETE CASCADE, - FOREIGN KEY (user_idx) REFERENCES users(user_idx) ON DELETE CASCADE, - FOREIGN KEY (test_file_idx) REFERENCES test_files(test_file_idx) ON DELETE CASCADE -); -CREATE INDEX reporting_user ON reporting(user_idx); -CREATE INDEX reporting_run ON reporting(run_id); -CREATE INDEX reporting_a ON reporting(project_idx); -CREATE INDEX reporting_b ON reporting(project_idx, user_idx); -CREATE INDEX reporting_e ON reporting(project_idx, test_file_idx, subtest, user_idx, reporting_idx); - -CREATE TABLE resource_batch ( - resource_batch_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - run_id UUID NOT NULL, - host_idx BIGINT NOT NULL, - stamp TIMESTAMP(4) NOT NULL, - - FOREIGN KEY (run_id) REFERENCES runs(run_id) ON DELETE CASCADE, - FOREIGN KEY (host_idx) REFERENCES hosts(host_idx) ON DELETE CASCADE -); -CREATE INDEX resource_batch_run ON resource_batch(run_id); + reporting_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, -CREATE TABLE resources ( - resource_idx INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - resource_batch_idx BIGINT NOT NULL, - module VARCHAR(512) NOT NULL, - data JSON NOT NULL, + job_try_id INTEGER DEFAULT NULL REFERENCES job_tries(job_try_id) ON DELETE SET NULL, + test_file_id INTEGER DEFAULT NULL REFERENCES test_files(test_file_id) ON DELETE CASCADE, + + project_id INTEGER NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, + user_id INTEGER NOT NULL REFERENCES users(user_id) ON DELETE CASCADE, + run_id INTEGER NOT NULL REFERENCES runs(run_id) ON DELETE CASCADE, + + job_try SMALLINTEGER DEFAULT NULL, + + retry SMALLINTEGER NOT NULL, + abort SMALLINTEGER NOT NULL, + fail SMALLINTEGER NOT NULL, + pass SMALLINTEGER NOT NULL, - FOREIGN KEY (resource_batch_idx) REFERENCES resource_batch(resource_batch_idx) ON DELETE CASCADE + subtest VARCHAR(512) DEFAULT NULL, + duration NUMERIC(14,4) NOT NULL ); -CREATE INDEX resources_batch_idx ON resources(resource_batch_idx); +CREATE INDEX IF NOT EXISTS reporting_run ON reporting(run_id); +CREATE INDEX IF NOT EXISTS reporting_user ON reporting(user_id); +CREATE INDEX IF NOT EXISTS reporting_a ON reporting(project_id); +CREATE INDEX IF NOT EXISTS reporting_b ON reporting(project_id, user_id); +CREATE INDEX IF NOT EXISTS reporting_e ON reporting(project_id, test_file_id, subtest, user_id, reporting_id);