fix repeatable migrations

This commit is contained in:
Dusan Vojacek
2026-04-19 20:15:46 +02:00
parent 0c93f493a4
commit 22bca9cd9e
73 changed files with 22 additions and 15 deletions

View File

@@ -0,0 +1,17 @@
-- pack reg 6264 (Europe/Prague wall time, seconds = 0) stejně jako _deye_system_time_register_rows
create or replace function ems.fn_deye_pack_system_time(p_ts timestamptz)
returns int[]
language sql
stable
as $fn$
with loc as (
select (p_ts at time zone 'Europe/Prague') as t
)
select array[
((extract(year from t)::int - 2000) << 8) | extract(month from t)::int,
(extract(day from t)::int << 8) | extract(hour from t)::int,
(extract(minute from t)::int << 8) | 0
]
from loc;
$fn$;