Prevent accidental undo of initial baseline load.

This commit is contained in:
PhilRunninger 2023-05-03 15:34:17 -04:00
parent 9e1299e49c
commit cecd647ee7
5 changed files with 12 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -15,14 +15,18 @@
** 2. In a proper text editor, aka Neovim, remove all instances of NULL from the exported file, leaving nothing between the commas. ** 2. In a proper text editor, aka Neovim, remove all instances of NULL from the exported file, leaving nothing between the commas.
** 3. In DBeaver, ** 3. In DBeaver,
** a. Log into usmidsap01 ** a. Log into usmidsap01
** b. Navigate to the ubm.rlarp.osm_pool table ** b. Run the following statements in the ubm database:
** c. Right-click, and choose Import Data. ** TRUNCATE TABLE rlarp.osm_log CASCADE;
** d. Follow the self-explanatory steps in the wizard. Make sure to choose the option to empty the table first. **
** e. Verify the import worked correctly.
** f. Run the following statements to finish setting up the system.
** DELETE FROM rlarp.osm_log WHERE id > 1;
** ALTER SEQUENCE rlarp.osm_log_id_seq RESTART 1; ** ALTER SEQUENCE rlarp.osm_log_id_seq RESTART 1;
** **
** INSERT INTO rlarp.osm_log (doc)
** SELECT jsonb_build_object('user',current_user,'tag','baseline','type','build_pool','stamp',current_timestamp,'source','top level','message','DON''T UNDO')
** c. Navigate to the ubm.rlarp.osm_pool table
** d. Right-click, and choose Import Data.
** e. Follow the self-explanatory steps in the wizard. Make sure to choose the option to empty the table first.
** f. Verify the import worked correctly.
**
******************************************************************************************************************************************* *******************************************************************************************************************************************
******************************************************************************************************************************************* *******************************************************************************************************************************************

View File

@ -1,6 +1,6 @@
WITH WITH
d AS ( d AS (
DELETE FROM rlarp.osm_log WHERE id = replace_id RETURNING id DELETE FROM rlarp.osm_log WHERE id <> 1 AND id = replace_id RETURNING id
) )
,d_osm AS ( ,d_osm AS (
DELETE FROM rlarp.osm_pool WHERE logid IN (select id from d) DELETE FROM rlarp.osm_pool WHERE logid IN (select id from d)