diff options
author | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-06-26 13:15:39 +0000 |
---|---|---|
committer | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-06-26 13:15:39 +0000 |
commit | a88e4ef120a13064f2bf09238abfd7a1ea952a1a (patch) | |
tree | 9b7b7bf1e5cf7dcf0593d7501cee76389bfb3516 /create/schema/gen.pl | |
parent | 8c1d6551dd62846de078b06b522682d5ff9a5761 (diff) | |
download | zabbix-a88e4ef120a13064f2bf09238abfd7a1ea952a1a.tar.gz zabbix-a88e4ef120a13064f2bf09238abfd7a1ea952a1a.tar.xz zabbix-a88e4ef120a13064f2bf09238abfd7a1ea952a1a.zip |
- removed duplicate index of table httptest, more fixes for Oracle schema (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@4367 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'create/schema/gen.pl')
-rwxr-xr-x | create/schema/gen.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/create/schema/gen.pl b/create/schema/gen.pl index 53c03c76..37b3719f 100755 --- a/create/schema/gen.pl +++ b/create/schema/gen.pl @@ -29,6 +29,7 @@ close(INFO); # Close the file local $output; %mysql=( + "database" => "mysql", "type" => "sql", "before" => "", "after" => "", @@ -50,6 +51,7 @@ local $output; ); %c=( "type" => "code", + "database" => "", "after" => "\t{0}\n};\n", "t_bigint" => "ZBX_TYPE_UINT", "t_id" => "ZBX_TYPE_ID", @@ -89,6 +91,7 @@ static ZBX_TABLE tables[]={ "; %oracle=("t_bigint" => "number(20)", + "database" => "oracle", "before" => "", "after" => "", "type" => "sql", @@ -108,6 +111,7 @@ static ZBX_TABLE tables[]={ ); %postgresql=("t_bigint" => "bigint", + "database" => "postgresql", "before" => "", "after" => "", "type" => "sql", @@ -128,6 +132,7 @@ static ZBX_TABLE tables[]={ ); %sqlite=("t_bigint" => "bigint", + "database" => "sqlite", "before" => "", "after" => "", "type" => "sql", @@ -226,6 +231,12 @@ sub process_field s/$type_short/$a/g; $type_2=$_; if($default ne "") { $default="DEFAULT $default"; } + # Special processing for Oracle "default 'ZZZ' not null" -> "default 'ZZZ'. NULL=='' in Oracle!" + if(($output{"database"} eq "oracle") && (0==index($type_2,"varchar2"))) + { + # $default="DEFAULT NULL"; + $null=""; + } print "\t$name\t\t$type_2\t\t$default\t$null"; } } |