From 295e585ae307aa9b4d7f5028187d1954b44e76af Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 29 Oct 2010 12:52:48 +0200 Subject: [PATCH] =?utf8?q?Datenbankschema=20&=20Models=20f=C3=BCr=20Hinter?= =?utf8?q?grundjobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/BackgroundJob.pm | 13 ++++++++++ SL/DB/BackgroundJobHistory.pm | 13 ++++++++++ SL/DB/Helper/ALL.pm | 2 ++ SL/DB/Helper/Mappings.pm | 3 +++ SL/DB/MetaSetup/BackgroundJob.pm | 27 ++++++++++++++++++++ SL/DB/MetaSetup/BackgroundJobHistory.pm | 26 +++++++++++++++++++ sql/Pg-upgrade2/emmvee_background_jobs.sql | 29 ++++++++++++++++++++++ 7 files changed, 113 insertions(+) create mode 100644 SL/DB/BackgroundJob.pm create mode 100644 SL/DB/BackgroundJobHistory.pm create mode 100644 SL/DB/MetaSetup/BackgroundJob.pm create mode 100644 SL/DB/MetaSetup/BackgroundJobHistory.pm create mode 100644 sql/Pg-upgrade2/emmvee_background_jobs.sql diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm new file mode 100644 index 000000000..e6b099f55 --- /dev/null +++ b/SL/DB/BackgroundJob.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::BackgroundJob; + +use strict; + +use SL::DB::MetaSetup::BackgroundJob; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/BackgroundJobHistory.pm b/SL/DB/BackgroundJobHistory.pm new file mode 100644 index 000000000..f8e08f8d9 --- /dev/null +++ b/SL/DB/BackgroundJobHistory.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::BackgroundJobHistory; + +use strict; + +use SL::DB::MetaSetup::BackgroundJobHistory; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index 50f4b3db7..3757404dd 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -6,6 +6,8 @@ use SL::DB::AccTrans; use SL::DB::AccTransaction; use SL::DB::Assembly; use SL::DB::AuditTrail; +use SL::DB::BackgroundJob; +use SL::DB::BackgroundJobHistory; use SL::DB::BankAccount; use SL::DB::Bin; use SL::DB::Buchungsgruppe; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index 48c486307..475a7b28c 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -24,6 +24,9 @@ my %lxoffice_package_names = ( audittrail => 'audit_trail', ar => 'invoice', ap => 'purchase_invoice', + background_jobs => 'background_job', + background_job_histories => 'background_job_history', + ap => 'purchase_invoice', bank_accounts => 'bank_account', buchungsgruppen => 'buchungsgruppe', contacts => 'contact', diff --git a/SL/DB/MetaSetup/BackgroundJob.pm b/SL/DB/MetaSetup/BackgroundJob.pm new file mode 100644 index 000000000..c3b8212c9 --- /dev/null +++ b/SL/DB/MetaSetup/BackgroundJob.pm @@ -0,0 +1,27 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::BackgroundJob; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'background_jobs', + + columns => [ + id => { type => 'serial', not_null => 1 }, + type => { type => 'varchar', length => 255 }, + package_name => { type => 'varchar', length => 255 }, + last_run_at => { type => 'timestamp' }, + next_run_at => { type => 'timestamp' }, + data => { type => 'text' }, + active => { type => 'boolean' }, + cron_spec => { type => 'varchar', length => 255 }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/BackgroundJobHistory.pm b/SL/DB/MetaSetup/BackgroundJobHistory.pm new file mode 100644 index 000000000..bd78a7d50 --- /dev/null +++ b/SL/DB/MetaSetup/BackgroundJobHistory.pm @@ -0,0 +1,26 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::BackgroundJobHistory; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'background_job_histories', + + columns => [ + id => { type => 'serial', not_null => 1 }, + package_name => { type => 'varchar', length => 255 }, + run_at => { type => 'timestamp' }, + status => { type => 'varchar', length => 255 }, + result => { type => 'text' }, + error => { type => 'text', alias => 'error_col' }, + data => { type => 'text' }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/sql/Pg-upgrade2/emmvee_background_jobs.sql b/sql/Pg-upgrade2/emmvee_background_jobs.sql new file mode 100644 index 000000000..fff75c781 --- /dev/null +++ b/sql/Pg-upgrade2/emmvee_background_jobs.sql @@ -0,0 +1,29 @@ +-- @tag: emmvee_background_jobs +-- @description: Tabellen für Hintergrundjobs +-- @depends: release_2_6_1 +-- @charset: utf-8 + +CREATE TABLE background_jobs ( + id serial NOT NULL, + type character varying(255), + package_name character varying(255), + last_run_at timestamp without time zone, + next_run_at timestamp without time zone, + data text, + active boolean, + cron_spec character varying(255), + + PRIMARY KEY (id) +); + +CREATE TABLE background_job_histories ( + id serial NOT NULL, + package_name character varying(255), + run_at timestamp without time zone, + status character varying(255), + result text, + error text, + data text, + + PRIMARY KEY (id) +); -- 2.20.1