START TRANSACTION;

ALTER TYPE property_type
    RENAME TO _property_type;

CREATE TYPE property_type
    AS ENUM ('BOOLEAN', 'STRING');

ALTER TABLE property
    ALTER COLUMN type TYPE property_type USING type :: text :: property_type;

DROP TYPE _property_type;

CREATE TABLE property_string_value
(
    property_id BIGINT PRIMARY KEY REFERENCES property (id) ON UPDATE CASCADE,
    value       TEXT NOT NULL
);

COMMIT;