X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7f2cf94759beb6f08ff67bea0b3d1eca671ede3d..8688e71eb56abdd9641f07a47135bb02841607fb:/sql/Pg-upgrade2/custom_variables.sql?ds=sidebyside

diff --git a/sql/Pg-upgrade2/custom_variables.sql b/sql/Pg-upgrade2/custom_variables.sql
new file mode 100644
index 000000000..884594a53
--- /dev/null
+++ b/sql/Pg-upgrade2/custom_variables.sql
@@ -0,0 +1,51 @@
+-- @tag: custom_variables
+-- @description: Benutzerdefinierte Variablen f&uuml;r beliebige Module. Hier nur f&uuml;r Kunden- und Lieferantenstammdaten implementiert.
+-- @depends: release_2_4_3
+CREATE SEQUENCE custom_variable_configs_id;
+CREATE TABLE custom_variable_configs (
+       id integer NOT NULL DEFAULT nextval('custom_variable_configs_id'),
+       name text,
+       description text,
+       type varchar(20),
+       module varchar(20),
+       default_value text,
+       options text,
+       searchable boolean,
+       includeable boolean,
+       included_by_default boolean,
+       sortkey integer,
+
+       itime timestamp DEFAULT now(),
+       mtime timestamp,
+
+       PRIMARY KEY (id)
+);
+
+CREATE TRIGGER mtime_custom_variable_configs
+    BEFORE UPDATE ON custom_variable_configs
+    FOR EACH ROW
+    EXECUTE PROCEDURE set_mtime();
+
+CREATE SEQUENCE custom_variables_id;
+CREATE TABLE custom_variables (
+       id integer NOT NULL DEFAULT nextval('custom_variables_id'),
+       config_id integer NOT NULL,
+       trans_id integer NOT NULL,
+
+       bool_value boolean,
+       timestamp_value timestamp,
+       text_value text,
+       number_value numeric(25,5),
+
+       itime timestamp DEFAULT now(),
+       mtime timestamp,
+
+       PRIMARY KEY (id),
+       FOREIGN KEY (config_id) REFERENCES custom_variable_configs (id)
+);
+
+CREATE TRIGGER mtime_custom_variables
+    BEFORE UPDATE ON custom_variables
+    FOR EACH ROW
+    EXECUTE PROCEDURE set_mtime();
+
