2022-05-25 22:48:38 +02:00
|
|
|
-- v49: Convert first_expected_ts to BIGINT
|
2022-05-24 17:50:38 +02:00
|
|
|
-- only: postgres
|
2022-05-25 22:48:38 +02:00
|
|
|
|
|
|
|
DO
|
|
|
|
$do$
|
|
|
|
BEGIN
|
|
|
|
IF (SELECT data_type FROM information_schema.columns WHERE table_name='backfill_state' AND column_name='first_expected_ts') = 'integer' THEN
|
|
|
|
ALTER TABLE backfill_state ALTER COLUMN first_expected_ts TYPE BIGINT;
|
|
|
|
ELSE
|
|
|
|
ALTER TABLE backfill_state ALTER COLUMN first_expected_ts TYPE BIGINT USING EXTRACT(EPOCH FROM first_expected_ts);
|
|
|
|
END IF;
|
|
|
|
END
|
|
|
|
$do$
|