-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OK-565 Fine-tune migration comments and initial start timestamp
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
14 changes: 7 additions & 7 deletions
14
...-db/src/main/resources/db/migration-vts/V20242205000000__create_siirtotiedostot_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
create table if not exists siirtotiedostot ( | ||
id serial, --todo, voisi katsoa, jos kaikkeen tiedostojen muodostamiseen liittyvään lokitukseen tai ainakin virheisiin saataisiin mukaan tämä id | ||
id serial, | ||
uuid varchar, | ||
window_start varchar not null, | ||
window_end varchar not null, | ||
run_start timestamp with time zone, | ||
run_end timestamp with time zone, | ||
info jsonb, --ainakin tilastot tiedostoihin päätyneistä entiteettimääristä tyypeittäin, {"entityTotals": {"tyyppi1": 300, "tyyppi2": 13}} | ||
info jsonb, | ||
success boolean, | ||
error_message varchar, | ||
PRIMARY KEY (id) | ||
); | ||
|
||
COMMENT ON column siirtotiedostot.run_start IS 'Siirtotiedosto-operaation suorituksen alkuaika'; | ||
COMMENT ON column siirtotiedostot.run_end IS 'Siirtotiedosto-operaation suorituksen loppuaika'; | ||
COMMENT ON column siirtotiedostot.window_start IS 'Siirtotiedosto-operaation käsittelemän aikaikkunan alkuaika'; | ||
COMMENT ON column siirtotiedostot.window_end IS 'Siirtotiedosto-operaation käsittelemän aikaikkunan loppuaika'; | ||
COMMENT ON column siirtotiedostot.info IS 'Tietoja tallennetuista entiteeteistä, mm. lukumäärät'; | ||
COMMENT ON column siirtotiedostot.error_message IS 'null, jos mikään ei mennyt vikaan'; | ||
COMMENT ON column siirtotiedostot.error_message IS 'Mahdollisen operaation katkaisseen virheen otsikko'; | ||
|
||
--alter table siirtotiedosto owner to oph; | ||
|
||
--todo, what are the initial values? This is just something to get the poc started. | ||
--Add a baseline success, so that the first timed run doesn't try to process all the data at once. Data prior to 2024-08-01 00:00:00.000000 +00:00 should be manually processed through swagger once. | ||
insert into siirtotiedostot(id, uuid, window_start, window_end, run_start, run_end, info, success, error_message) | ||
values (1, '57be2612-ba79-429e-a93e-c38346f1d62d', '1990-01-01 10:41:20.538107 +00:00', '2024-04-10 10:41:20.538107 +00:00', now(), now(), '{"entityTotals": {}}'::jsonb, true, null) on conflict do nothing; | ||
values (1, '57be2612-ba79-429e-a93e-c38346f1d62d', '1990-01-01 10:41:20.538107 +00:00', '2024-08-01 00:00:00.000000 +00:00', now(), now(), '{"entityTotals": {}}'::jsonb, true, null) on conflict do nothing; |