summaryrefslogtreecommitdiffstats
path: root/create
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-08 16:03:19 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-08 16:03:19 +0000
commit92ef7bbf6a7c38984e4cd596dcb86b5e2a1faafb (patch)
tree0c512d79a88744d2c6d6e5b15b8a6d0cd69ea6e2 /create
parent40d8696d1b58c0f76ee82ba8ebdb90e965efcd62 (diff)
downloadzabbix-92ef7bbf6a7c38984e4cd596dcb86b5e2a1faafb.tar.gz
zabbix-92ef7bbf6a7c38984e4cd596dcb86b5e2a1faafb.tar.xz
zabbix-92ef7bbf6a7c38984e4cd596dcb86b5e2a1faafb.zip
- improved configuration script
- added suport of 'make dist' - fixed some bugs with DB supporting git-svn-id: svn://svn.zabbix.com/trunk@3814 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'create')
-rw-r--r--create/Makefile.am11
-rw-r--r--create/schema/Makefile.am10
-rwxr-xr-xcreate/schema/gen.pl29
-rw-r--r--create/schema/schema.sql22
4 files changed, 46 insertions, 26 deletions
diff --git a/create/Makefile.am b/create/Makefile.am
new file mode 100644
index 00000000..127d3925
--- /dev/null
+++ b/create/Makefile.am
@@ -0,0 +1,11 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = schema
+
+EXTRA_DIST = \
+ data/data.sql \
+ data/images_oracle.sql \
+ data/images_pgsql.sql \
+ data/images.sql \
+ data/images_sqlite3.sql
+
diff --git a/create/schema/Makefile.am b/create/schema/Makefile.am
new file mode 100644
index 00000000..122964f2
--- /dev/null
+++ b/create/schema/Makefile.am
@@ -0,0 +1,10 @@
+## Process this file with automake to produce Makefile.in
+
+## "dist-hook" run after the distribution directory is filled, but before the actual tar (or shar) file is created.
+dist-hook:
+ $(srcdir)/gen.pl mysql > $(distdir)/mysql.sql
+ $(srcdir)/gen.pl postgresql > $(distdir)/postgresql.sql
+ $(srcdir)/gen.pl sqlite3 > $(distdir)/sqlite3.sql
+ $(srcdir)/gen.pl oracle > $(distdir)/oracle.sql
+ $(srcdir)/gen.pl c > $(top_distdir)/include/dbsync.h
+
diff --git a/create/schema/gen.pl b/create/schema/gen.pl
index 04cf83f9..6200fadc 100755
--- a/create/schema/gen.pl
+++ b/create/schema/gen.pl
@@ -40,8 +40,7 @@ local $output;
"t_image" => "longblob",
"t_history_log" => "text",
"t_history_text"=> "text",
-# "t_text" => "blob"
- "t_text" => "text"
+ "t_blob" => "blob"
);
%c=( "type" => "code",
@@ -57,7 +56,7 @@ local $output;
"t_image" => "ZBX_TYPE_BLOB",
"t_history_log" => "ZBX_TYPE_TEXT",
"t_history_text"=> "ZBX_TYPE_TEXT",
- "t_text" => "ZBX_TYPE_BLOB"
+ "t_blob" => "ZBX_TYPE_BLOB"
);
$c{"before"}="
@@ -81,20 +80,20 @@ ZBX_TABLE
static ZBX_TABLE tables[]={
";
-%oracle=("t_bigint" => "number(21)",
+%oracle=("t_bigint" => "bigint",
"before" => "",
"after" => "",
"type" => "sql",
- "t_id" => "number(21)",
- "t_integer" => "number(10)",
+ "t_id" => "bigint",
+ "t_integer" => "integer",
"t_serial" => "serial",
- "t_double" => "number(20,4)",
- "t_varchar" => "varchar2",
- "t_char" => "varchar2",
- "t_image" => "blob",
- "t_history_log" => "varchar2(4000)",
- "t_history_text"=> "CLOB",
- "t_text" => "varchar2(4000)"
+ "t_double" => "double",
+ "t_varchar" => "varchar",
+ "t_char" => "char",
+ "t_image" => "longblob",
+ "t_history_log" => "text",
+ "t_history_text"=> "text",
+ "t_blob" => "blob"
);
%postgresql=("t_bigint" => "bigint",
@@ -111,7 +110,7 @@ static ZBX_TABLE tables[]={
"t_history_log" => "varchar(255)",
"t_history_text"=> "text",
"t_time" => "integer",
- "t_text" => "text"
+ "t_blob" => "text"
);
%sqlite=("t_bigint" => "bigint",
@@ -127,7 +126,7 @@ static ZBX_TABLE tables[]={
"t_image" => "longblob",
"t_history_log" => "text",
"t_history_text"=> "text",
- "t_text" => "blob"
+ "t_blob" => "blob"
);
sub newstate
diff --git a/create/schema/schema.sql b/create/schema/schema.sql
index bca11423..b2923e75 100644
--- a/create/schema/schema.sql
+++ b/create/schema/schema.sql
@@ -32,7 +32,7 @@ FIELD |curstep |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |lastfailedstep |t_id |'0' |NOT NULL |ZBX_SYNC
FIELD |delay |t_integer |'60' |NOT NULL |ZBX_SYNC
FIELD |status |t_integer |'0' |NOT NULL |ZBX_SYNC
-FIELD |macros |t_text |'' |NOT NULL |ZBX_SYNC
+FIELD |macros |t_blob |'' |NOT NULL |ZBX_SYNC
FIELD |agent |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
FIELD |time |t_double(16,4) |'0' |NOT NULL |ZBX_SYNC
FIELD |error |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
@@ -45,7 +45,7 @@ FIELD |name |t_varchar(64) |'' |NOT NULL |ZBX_SYNC
FIELD |no |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |url |t_varchar(128) |'' |NOT NULL |ZBX_SYNC
FIELD |timeout |t_integer |'30' |NOT NULL |ZBX_SYNC
-FIELD |posts |t_text |'' |NOT NULL |ZBX_SYNC
+FIELD |posts |t_blob |'' |NOT NULL |ZBX_SYNC
FIELD |required |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
INDEX |httpstep_1 |httptestid
@@ -147,7 +147,7 @@ FIELD |clock |t_time |'0' |NOT NULL |ZBX_SYNC
FIELD |mediatypeid |t_id |'0' |NOT NULL |ZBX_SYNC
FIELD |sendto |t_varchar(100) |'' |NOT NULL |ZBX_SYNC
FIELD |subject |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
-FIELD |message |t_text |'' |NOT NULL |ZBX_SYNC
+FIELD |message |t_blob |'' |NOT NULL |ZBX_SYNC
FIELD |status |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |retries |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |error |t_varchar(128) |'' |NOT NULL |ZBX_SYNC
@@ -230,14 +230,14 @@ TABLE|actions|actionid|ZBX_SYNC
FIELD |actionid |t_id |'0' |NOT NULL |ZBX_SYNC
FIELD |userid |t_id |'0' |NOT NULL |ZBX_SYNC
FIELD |subject |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
-FIELD |message |t_text |'' |NOT NULL |ZBX_SYNC
+FIELD |message |t_blob |'' |NOT NULL |ZBX_SYNC
FIELD |recipient |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |maxrepeats |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |repeatdelay |t_integer |'600' |NOT NULL |ZBX_SYNC
FIELD |source |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |actiontype |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |status |t_integer |'0' |NOT NULL |ZBX_SYNC
-FIELD |scripts |t_text |'' |NOT NULL |ZBX_SYNC
+FIELD |scripts |t_blob |'' |NOT NULL |ZBX_SYNC
TABLE|applications|applicationid|ZBX_SYNC
FIELD |applicationid |t_id |'0' |NOT NULL |ZBX_SYNC
@@ -353,11 +353,11 @@ FIELD |os |t_varchar(64) |'' |NOT NULL |ZBX_SYNC
FIELD |serialno |t_varchar(64) |'' |NOT NULL |ZBX_SYNC
FIELD |tag |t_varchar(64) |'' |NOT NULL |ZBX_SYNC
FIELD |macaddress |t_varchar(64) |'' |NOT NULL |ZBX_SYNC
-FIELD |hardware |t_text |'' |NOT NULL |ZBX_SYNC
-FIELD |software |t_text |'' |NOT NULL |ZBX_SYNC
-FIELD |contact |t_text |'' |NOT NULL |ZBX_SYNC
-FIELD |location |t_text |'' |NOT NULL |ZBX_SYNC
-FIELD |notes |t_text |'' |NOT NULL |ZBX_SYNC
+FIELD |hardware |t_blob |'' |NOT NULL |ZBX_SYNC
+FIELD |software |t_blob |'' |NOT NULL |ZBX_SYNC
+FIELD |contact |t_blob |'' |NOT NULL |ZBX_SYNC
+FIELD |location |t_blob |'' |NOT NULL |ZBX_SYNC
+FIELD |notes |t_blob |'' |NOT NULL |ZBX_SYNC
TABLE|hosts_templates|hosttemplateid|ZBX_SYNC
FIELD |hosttemplateid |t_id |'0' |NOT NULL |ZBX_SYNC
@@ -569,7 +569,7 @@ FIELD |value |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |priority |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |lastchange |t_integer |'0' |NOT NULL |ZBX_SYNC
FIELD |dep_level |t_integer |'0' |NOT NULL |ZBX_SYNC
-FIELD |comments |t_text | | |ZBX_SYNC
+FIELD |comments |t_blob | | |ZBX_SYNC
FIELD |error |t_varchar(128) |'' |NOT NULL |ZBX_SYNC
FIELD |templateid |t_id |'0' |NOT NULL |ZBX_SYNC
INDEX |1 |status