Commit 45b2257e authored by Enriko Käsper's avatar Enriko Käsper
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Enriko Käsper

See merge request teis/officials-service!49
parents b3d3d007 be14c23e
theGroup=ee.sm.ti.teis theGroup=ee.sm.ti.teis
theVersion=1.10.0 theVersion=1.10.1
commonsVersion=1.14.0 commonsVersion=1.14.0
officeApiGatewayVersion=1.14.0 officeApiGatewayVersion=1.14.0
pluginVersion=1.2.0 pluginVersion=1.2.0
--liquibase formatted sql --liquibase formatted sql
--changeset enriko:2021-01-20.TEIS-1784.generate-created_at-values.sql splitStatements:false --changeset enriko:2021-01-20.TEIS-1784.generate-created_at-values_v2 splitStatements:false
create or replace function fill_created_at_value(tableName varchar, idType varchar) create or replace function fill_created_at_value(tableName varchar, idType varchar)
returns void returns void
...@@ -14,10 +14,10 @@ begin ...@@ -14,10 +14,10 @@ begin
select createdAt + interval '1 second' into createdAt; select createdAt + interval '1 second' into createdAt;
if idType = 'uuid' then if idType = 'uuid' then
-- RAISE NOTICE 'ID= "%"', rec.id::text; -- RAISE NOTICE 'ID= "%"', rec.id::text;
execute 'update ' || quote_ident(tableName) || ' set created_by = ''SYSTEM'', created_at = ''' || createdAt || ''', modified_at = ''' || createdAt || ''' where id=''' || rec.id::text || ''''; execute 'update ' || quote_ident(tableName) || ' set created_by = ''SYSTEM'', created_at = ''' || createdAt || ''' where id=''' || rec.id::text || '''';
else else
-- RAISE NOTICE 'ID str= "%"', rec.id; -- RAISE NOTICE 'ID str= "%"', rec.id;
execute 'update ' || quote_ident(tableName) || ' set created_by = ''SYSTEM'', created_at = ''' || createdAt || ''', modified_at = ''' || createdAt || ''' where id=''' || rec.id || ''''; execute 'update ' || quote_ident(tableName) || ' set created_by = ''SYSTEM'', created_at = ''' || createdAt || ''' where id=''' || rec.id || '''';
end if; end if;
-- RAISE NOTICE 'createdAt "%"', createdAt; -- RAISE NOTICE 'createdAt "%"', createdAt;
end loop; end loop;
...@@ -26,4 +26,5 @@ end $$ ...@@ -26,4 +26,5 @@ end $$
select fill_created_at_value('office', 'uuid'); select fill_created_at_value('office', 'uuid');
drop function fill_created_at_value(varchar, varchar); drop function if exists fill_created_at_value(varchar, varchar);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment