From ad46cc4c58c14071a2922c1154dfa3daebac4417 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 6 Apr 2022 10:33:55 +0200 Subject: [PATCH] =?utf8?q?Volltext-Suche:=20Tabelle=20f=C3=BCr=20Texte=20a?= =?utf8?q?us=20Dateien=20im=20DMS.=20DB=20und=20Rose?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/FileFullText.pm | 13 ++++++++++++ SL/DB/Helper/ALL.pm | 1 + SL/DB/Helper/Mappings.pm | 1 + SL/DB/Manager/FileFullText.pm | 14 +++++++++++++ SL/DB/MetaSetup/FileFullText.pm | 31 +++++++++++++++++++++++++++++ sql/Pg-upgrade2/file_full_texts.sql | 15 ++++++++++++++ 6 files changed, 75 insertions(+) create mode 100644 SL/DB/FileFullText.pm create mode 100644 SL/DB/Manager/FileFullText.pm create mode 100644 SL/DB/MetaSetup/FileFullText.pm create mode 100644 sql/Pg-upgrade2/file_full_texts.sql diff --git a/SL/DB/FileFullText.pm b/SL/DB/FileFullText.pm new file mode 100644 index 000000000..6c6cff437 --- /dev/null +++ b/SL/DB/FileFullText.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::FileFullText; + +use strict; + +use SL::DB::MetaSetup::FileFullText; +use SL::DB::Manager::FileFullText; + +__PACKAGE__->meta->initialize; + +1; diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index 633373b73..93848a0fa 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -61,6 +61,7 @@ use SL::DB::Employee; use SL::DB::EmployeeProjectInvoices; use SL::DB::Exchangerate; use SL::DB::File; +use SL::DB::FileFullText; use SL::DB::Finanzamt; use SL::DB::FollowUp; use SL::DB::FollowUpAccess; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index 8d0ed7e0c..4f78ac47c 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -144,6 +144,7 @@ my %kivitendo_package_names = ( employee_project_invoices => 'EmployeeProjectInvoices', exchangerate => 'exchangerate', files => 'file', + file_full_texts => 'file_full_text', finanzamt => 'finanzamt', follow_up_access => 'follow_up_access', follow_up_links => 'follow_up_link', diff --git a/SL/DB/Manager/FileFullText.pm b/SL/DB/Manager/FileFullText.pm new file mode 100644 index 000000000..bb1267d68 --- /dev/null +++ b/SL/DB/Manager/FileFullText.pm @@ -0,0 +1,14 @@ +# 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::Manager::FileFullText; + +use strict; + +use parent qw(SL::DB::Helper::Manager); + +sub object_class { 'SL::DB::FileFullText' } + +__PACKAGE__->make_manager_methods; + +1; diff --git a/SL/DB/MetaSetup/FileFullText.pm b/SL/DB/MetaSetup/FileFullText.pm new file mode 100644 index 000000000..2a9382220 --- /dev/null +++ b/SL/DB/MetaSetup/FileFullText.pm @@ -0,0 +1,31 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::FileFullText; + +use strict; + +use parent qw(SL::DB::Object); + +__PACKAGE__->meta->table('file_full_texts'); + +__PACKAGE__->meta->columns( + file_id => { type => 'integer', not_null => 1 }, + full_text => { type => 'text', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, + itime => { type => 'timestamp', default => 'now()', not_null => 1 }, + mtime => { type => 'timestamp' }, +); + +__PACKAGE__->meta->primary_key_columns([ 'id' ]); + +__PACKAGE__->meta->allow_inline_column_values(1); + +__PACKAGE__->meta->foreign_keys( + file => { + class => 'SL::DB::File', + key_columns => { file_id => 'id' }, + }, +); + +1; +; diff --git a/sql/Pg-upgrade2/file_full_texts.sql b/sql/Pg-upgrade2/file_full_texts.sql new file mode 100644 index 000000000..f479da137 --- /dev/null +++ b/sql/Pg-upgrade2/file_full_texts.sql @@ -0,0 +1,15 @@ +-- @tag: file_full_texts +-- @description: Tabelle f. Volltext-Suche anlegen +-- @depends: release_3_6_0 + +CREATE TABLE IF NOT EXISTS file_full_texts ( + id SERIAL, + file_id INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE, + full_text TEXT NOT NULL, + itime TIMESTAMP NOT NULL DEFAULT now(), + mtime TIMESTAMP, + + PRIMARY KEY (id) +); + +CREATE TRIGGER mtime_file_full_texts BEFORE UPDATE ON file_full_texts FOR EACH ROW EXECUTE PROCEDURE set_mtime(); -- 2.20.1