From: Bernd Bleßmann Date: Wed, 6 Apr 2022 08:33:55 +0000 (+0200) Subject: Volltext-Suche: Tabelle für Texte aus Dateien im DMS. DB und Rose X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~27 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ad46cc4c58c14071a2922c1154dfa3daebac4417;p=kivitendo-erp.git Volltext-Suche: Tabelle für Texte aus Dateien im DMS. DB und Rose --- 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();