diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-01-30 09:03:08 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-01-30 09:03:08 +0000 |
commit | c61a81d2dd77da53de0bf100208a3e1a10386f75 (patch) | |
tree | ab6fc70298fea93680b1242bbf2da9a057fe13b3 /create/schema/gen.pl | |
parent | 18e8abdc03c470bdca19328643a7243de1fb6625 (diff) | |
download | zabbix-c61a81d2dd77da53de0bf100208a3e1a10386f75.tar.gz zabbix-c61a81d2dd77da53de0bf100208a3e1a10386f75.tar.xz zabbix-c61a81d2dd77da53de0bf100208a3e1a10386f75.zip |
- [DEV-105] Database changes
[Proxy]
git-svn-id: svn://svn.zabbix.com/trunk@5290 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'create/schema/gen.pl')
-rwxr-xr-x | create/schema/gen.pl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/create/schema/gen.pl b/create/schema/gen.pl index cf858f3c..21845725 100755 --- a/create/schema/gen.pl +++ b/create/schema/gen.pl @@ -84,15 +84,26 @@ ZBX_FIELD int flags; }; +#define ZBX_MAX_FIELDS 64 #define ZBX_TABLE struct zbx_table_type ZBX_TABLE { char *table; char *recid; int flags; - ZBX_FIELD fields[64]; + ZBX_FIELD fields[ZBX_MAX_FIELDS]; }; +#ifdef HAVE_ORACLE +# define ZBX_DBTYPE_INT64 \"number(20)\" +#elif HAVE_POSTGRESQL +# define ZBX_DBTYPE_INT64 \"bigint\" +#elif HAVE_MYSQL +# define ZBX_DBTYPE_INT64 \"bigint unsigned\" +#elif HAVE_SQLITE3 +# define ZBX_DBTYPE_INT64 \"bigint\" +#endif + static ZBX_TABLE tables[]={ "; @@ -198,6 +209,9 @@ sub process_table { $flags="0"; } + for ($flags) { + s/,/ \| /; + } print "\t{\"${table_name}\",\t\"${pkey}\",\t${flags},\n\t\t{\n"; } else @@ -234,7 +248,9 @@ sub process_field $flags="ZBX_NOTNULL"; } } - + for ($flags) { + s/,/ \| /; + } print "\t\t{\"${name}\",\t$type,\t${flags}}"; } else |