mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
schema: make rule_name and source_name unique
This commit is contained in:
parent
1b1da71f31
commit
885eadac0a
9
schema/mysql-migrations/upgrade_152.sql
Normal file
9
schema/mysql-migrations/upgrade_152.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
ALTER TABLE import_source
|
||||||
|
ADD UNIQUE INDEX source_name (source_name);
|
||||||
|
|
||||||
|
ALTER TABLE sync_rule
|
||||||
|
ADD UNIQUE INDEX rule_name (rule_name);
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (152, NOW());
|
@ -1296,6 +1296,7 @@ CREATE TABLE import_source (
|
|||||||
last_attempt DATETIME DEFAULT NULL,
|
last_attempt DATETIME DEFAULT NULL,
|
||||||
description TEXT DEFAULT NULL,
|
description TEXT DEFAULT NULL,
|
||||||
PRIMARY KEY (id),
|
PRIMARY KEY (id),
|
||||||
|
UNIQUE INDEX source_name (source_name),
|
||||||
INDEX search_idx (key_column)
|
INDEX search_idx (key_column)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
@ -1441,7 +1442,8 @@ CREATE TABLE sync_rule (
|
|||||||
last_error_message TEXT DEFAULT NULL,
|
last_error_message TEXT DEFAULT NULL,
|
||||||
last_attempt DATETIME DEFAULT NULL,
|
last_attempt DATETIME DEFAULT NULL,
|
||||||
description TEXT DEFAULT NULL,
|
description TEXT DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id),
|
||||||
|
UNIQUE INDEX rule_name (rule_name)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE sync_property (
|
CREATE TABLE sync_property (
|
||||||
@ -1730,4 +1732,4 @@ CREATE TABLE icinga_timeperiod_exclude (
|
|||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (151, NOW());
|
VALUES (152, NOW());
|
||||||
|
7
schema/pgsql-migrations/upgrade_152.sql
Normal file
7
schema/pgsql-migrations/upgrade_152.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
CREATE UNIQUE INDEX import_source_name ON import_source (source_name);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX sync_rule_name ON sync_rule (rule_name);
|
||||||
|
|
||||||
|
INSERT INTO director_schema_migration
|
||||||
|
(schema_version, migration_time)
|
||||||
|
VALUES (152, NOW());
|
@ -1439,6 +1439,7 @@ CREATE TABLE import_source (
|
|||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX import_source_search_idx ON import_source (key_column);
|
CREATE INDEX import_source_search_idx ON import_source (key_column);
|
||||||
|
CREATE UNIQUE INDEX import_source_name ON import_source (source_name);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE import_source_setting (
|
CREATE TABLE import_source_setting (
|
||||||
@ -1594,6 +1595,7 @@ CREATE TABLE sync_rule (
|
|||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX sync_rule_name ON sync_rule (rule_name);
|
||||||
|
|
||||||
CREATE TABLE sync_property (
|
CREATE TABLE sync_property (
|
||||||
id serial,
|
id serial,
|
||||||
@ -2025,4 +2027,4 @@ CREATE TABLE icinga_timeperiod_exclude (
|
|||||||
|
|
||||||
INSERT INTO director_schema_migration
|
INSERT INTO director_schema_migration
|
||||||
(schema_version, migration_time)
|
(schema_version, migration_time)
|
||||||
VALUES (151, NOW());
|
VALUES (152, NOW());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user