Vendor dependencies

This commit is contained in:
2026-08-01 16:11:49 +03:00
parent 7f139a0241
commit 6b5e7f0f8b
29706 changed files with 9575646 additions and 0 deletions
@@ -0,0 +1,7 @@
CREATE TABLE migrations_simple_test (
some_id BIGINT NOT NULL PRIMARY KEY,
some_payload BIGINT NOT NUll
);
INSERT INTO migrations_simple_test (some_id, some_payload)
VALUES (1, 100);
@@ -0,0 +1,34 @@
-- Perform a tricky conversion of the payload.
--
-- This script will only succeed once and will fail if executed twice.
-- set up temporary target column
ALTER TABLE migrations_simple_test
ADD some_payload_tmp TEXT;
-- perform conversion
-- This will fail if `some_payload` is already a string column due to the addition.
-- We add a suffix after the addition to ensure that the SQL database does not silently cast the string back to an
-- integer.
UPDATE migrations_simple_test
SET some_payload_tmp = CONCAT(CAST((some_payload + 10) AS TEXT), '_suffix');
-- remove original column including the content
ALTER TABLE migrations_simple_test
DROP COLUMN some_payload;
-- prepare new payload column (nullable, so we can copy over the data)
ALTER TABLE migrations_simple_test
ADD some_payload TEXT;
-- copy new values
UPDATE migrations_simple_test
SET some_payload = some_payload_tmp;
-- "freeze" column
ALTER TABLE migrations_simple_test
ALTER COLUMN some_payload SET NOT NULL;
-- clean up
ALTER TABLE migrations_simple_test
DROP COLUMN some_payload_tmp;