@@ -1427,18 +1427,18 @@ create table test_history
14271427(
14281428 id integer  generated always as  identity primary key ,
14291429 reference_id integer  not null , --  идентификатор связанной сущности, FK быть не должно, т.к. запись м.б. удалена
1430-  triggered_at  timestamp (0 ) with time zone  not null  default now() check  (triggered_at  <=  now() +  interval ' 10m' 
1430+  created_at  timestamp (0 ) with time zone  not null  default now() check  (created_at  <=  now() +  interval ' 10m' 
14311431 old_data jsonb check (jsonb_typeof(old_data) =  ' object' 
14321432 new_data jsonb check (jsonb_typeof(new_data) =  ' object' 
14331433 check  (not (old_data is null  and  new_data is null ))
14341434);
14351435
14361436create  index  on  test_history (reference_id);
1437- create  index  on  test_history using brin (triggered_at );
1437+ create  index  on  test_history using brin (created_at );
14381438
14391439comment on column test_history.id is  ' ID' 
14401440comment on column test_history.reference_id is  ' ID в таблице test (существующий или удалённый)' 
1441- comment on column test_history.triggered_at  is  ' Дата-время действия' 
1441+ comment on column test_history.created_at  is  ' Дата-время действия' 
14421442comment on column test_history.old_data is  ' Старые данные (для INSERT всегда NULL)' 
14431443comment on column test_history.new_data is  ' Новые данные (для DELETE всегда NULL)' 
14441444
0 commit comments