mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
Add SQL migration file
This commit is contained in:
parent
3e4e00c8af
commit
0f123a2291
30
schema/mysql-migrations/upgrade_190.sql
Normal file
30
schema/mysql-migrations/upgrade_190.sql
Normal file
@ -0,0 +1,30 @@
|
||||
CREATE TABLE director_property (
|
||||
uuid binary(16) NOT NULL,
|
||||
parent_uuid binary(16) NULL DEFAULT NULL,
|
||||
key_name varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
label varchar(255) COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
|
||||
value_type enum('string', 'number', 'bool', 'array', 'dict') COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
instantiable enum('y', 'n') NOT NULL DEFAULT 'n',
|
||||
PRIMARY KEY (uuid)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||
|
||||
CREATE TABLE icinga_host_property (
|
||||
host_uuid binary(16) NOT NULL,
|
||||
property_uuid binary(16) NOT NULL,
|
||||
required enum('y', 'n') NOT NULL DEFAULT 'n',
|
||||
PRIMARY KEY (host_uuid, property_uuid),
|
||||
CONSTRAINT icinga_host_property_host
|
||||
FOREIGN KEY host(host_uuid)
|
||||
REFERENCES icinga_host (uuid)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT icinga_host_custom_property
|
||||
FOREIGN KEY property(property_uuid)
|
||||
REFERENCES director_property (uuid)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||
|
||||
INSERT INTO director_schema_migration
|
||||
(schema_version, migration_time)
|
||||
VALUES (190, NOW());
|
Loading…
x
Reference in New Issue
Block a user