Volltext-Suche: Tabelle für Texte aus Dateien im DMS. DB und Rose
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 6 Apr 2022 08:33:55 +0000 (10:33 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Wed, 18 May 2022 12:13:13 +0000 (14:13 +0200)
SL/DB/FileFullText.pm [new file with mode: 0644]
SL/DB/Helper/ALL.pm
SL/DB/Helper/Mappings.pm
SL/DB/Manager/FileFullText.pm [new file with mode: 0644]
SL/DB/MetaSetup/FileFullText.pm [new file with mode: 0644]
sql/Pg-upgrade2/file_full_texts.sql [new file with mode: 0644]

diff --git a/SL/DB/FileFullText.pm b/SL/DB/FileFullText.pm
new file mode 100644 (file)
index 0000000..6c6cff4
--- /dev/null
@@ -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;
index 633373b..93848a0 100644 (file)
@@ -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;
index 8d0ed7e..4f78ac4 100644 (file)
@@ -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 (file)
index 0000000..bb1267d
--- /dev/null
@@ -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 (file)
index 0000000..2a93822
--- /dev/null
@@ -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 (file)
index 0000000..f479da1
--- /dev/null
@@ -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();