Skip to content

Commit

Permalink
IS-66.00 Database Schema
Browse files Browse the repository at this point in the history
PSP_PIMS S66.00 Sprint 65 2023-Oct-24
- Added tables:
  - PIMS_PROJECT_PRODUCT
  - PIMS_PROJECT_PRODUCT_HIST
  - PIMS_PROPERTY_ACTIVITY_DOCUMENT
  - PIMS_PROPERTY_ACTIVITY_DOCUMENT_HIST
- Altered tables:
  - PIMS_PRODUCT
  - PIMS_PRODUCT_HIST
  - PIMS_TAKE
  - PIMS_TAKE_HIST
- Dropped tables:
  - PIMS_PROP_PROP_CLASSIFICATION_HIST
- Added test scripts:
  - 057_PIMS_PROJECT_PRODUCT.sql
  - 058_PIMS_TAKE.sql
- Altered test scripts:
  - 040_PIMS_PRODUCT.sql
  - 048_PIMS_COMPENSATION_REQUISITION.sql
- Requires additional metadata to meet standards
  • Loading branch information
dfilteau committed Oct 25, 2023
1 parent 4041a9a commit fdb5f83
Show file tree
Hide file tree
Showing 184 changed files with 68,435 additions and 20,516 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*******************************************************************************
Set the current value of the PIMS_ACQUISITION_FILE_TEAM_ID_SEQ sequence to the
PIMS_ACQUISITION_FILE_PERSON_ID_SEQ sequence post-Alter_Up.
Get the current rows from PIMS_PROJECT_PRODUCT to copy to TMP_PIMS_PRODUCT
pre-Alter_Down.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Author Date Comment
------------ ----------- -----------------------------------------------------
Doug Filteau 2023-Oct-11 Original version.
Doug Filteau 2023-Oct-18 Original version.
*******************************************************************************/

SET XACT_ABORT ON
Expand All @@ -14,21 +14,27 @@ GO
BEGIN TRANSACTION
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO

-- Copy the existing data for PIMS_ACQUISITION_FILE_PERSON_ID_SEQ
DECLARE @CurrVal BIGINT;
DECLARE @ExecStr NVARCHAR(1000);

SET @CurrVal = (SELECT SEQ_VAL FROM TMP_ACQUISITION_FILE_SEQ_VAL);
SET @ExecStr = N'ALTER SEQUENCE PIMS_ACQUISITION_FILE_TEAM_ID_SEQ RESTART WITH ' + CAST(@CurrVal AS NVARCHAR(10));
-- Drop the existing temporary table TMP_PIMS_PRODUCT
DROP TABLE IF EXISTS TMP_PIMS_PRODUCT
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO

EXEC(@ExecStr);
-- Create the temporary table TMP_PIMS_PRODUCT
CREATE TABLE TMP_PIMS_PRODUCT (
ID BIGINT,
PARENT_PROJECT_ID BIGINT)
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO

-- Drop the existing temporary table for TMP_ACQUISITION_FILE_SEQ_VAL
DROP TABLE IF EXISTS [dbo].[TMP_ACQUISITION_FILE_SEQ_VAL]
-- Copy the existing data from PIMS_PRODUCT
INSERT INTO TMP_PIMS_PRODUCT (ID, PARENT_PROJECT_ID)
SELECT PRODUCT_ID
, PROJECT_ID
FROM PIMS_PROJECT_PRODUCT
GO
IF @@ERROR <> 0 SET NOEXEC ON
GO
Expand Down
Loading

0 comments on commit fdb5f83

Please sign in to comment.