mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-06-04 22:32:55 -04:00
Add SPDX license headers and mark source files as GPL-3.0-or-later to preserve the option to relicense under later GPL versions.
14 lines
728 B
SQL
14 lines
728 B
SQL
-- SPDX-FileCopyrightText: 2023 Icinga GmbH <https://icinga.com>
|
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
ALTER TABLE director_datafield ADD COLUMN uuid bytea UNIQUE CHECK(LENGTH(uuid) = 16);
|
|
UPDATE director_datafield SET uuid = decode(replace(gen_random_uuid()::text, '-', ''), 'hex') WHERE uuid IS NULL;
|
|
ALTER TABLE director_datafield ALTER COLUMN uuid SET NOT NULL;
|
|
|
|
ALTER TABLE director_datalist ADD COLUMN uuid bytea UNIQUE CHECK(LENGTH(uuid) = 16);
|
|
UPDATE director_datalist SET uuid = decode(replace(gen_random_uuid()::text, '-', ''), 'hex') WHERE uuid IS NULL;
|
|
ALTER TABLE director_datalist ALTER COLUMN uuid SET NOT NULL;
|
|
|
|
INSERT INTO director_schema_migration
|
|
(schema_version, migration_time)
|
|
VALUES (186, NOW());
|