-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add generated norm-eli columns to database
We removed some tests from the TimeBoundaryControllerIntegrationTest that where also covered by other tests in there. This reduces the amount of maintenance these tests require. RISDEV-5763
- Loading branch information
1 parent
5d218c7
commit 4ed247f
Showing
20 changed files
with
193 additions
and
1,058 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
18 changes: 18 additions & 0 deletions
18
backend/src/main/resources/db/migration/V0.21__normeli_and_documenteli.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ALTER TABLE norms RENAME COLUMN eli_manifestation TO eli_dokument_manifestation; | ||
-- For the FRBRManifestation the FRBRuri contains the subtype and format, this is different, than for FRBRExpression or FRBRWork. Therefore, we need to additionally remove those part from it. | ||
ALTER TABLE norms | ||
ADD COLUMN eli_norm_manifestation text GENERATED ALWAYS AS (regexp_replace((xpath( | ||
'(//*[local-name()="act"]/*[local-name()="meta"]/*[local-name()="identification"]/*[local-name()="FRBRManifestation"]/*[local-name()="FRBRuri"]/@value)', | ||
xml))[1]::text, '/[^/]*$', '')) STORED NOT NULL; | ||
|
||
ALTER TABLE norms RENAME COLUMN eli_expression TO eli_dokument_expression; | ||
ALTER TABLE norms | ||
ADD COLUMN eli_norm_expression text GENERATED ALWAYS AS ((xpath( | ||
'//*[local-name()="act"]/*[local-name()="meta"]/*[local-name()="identification"]/*[local-name()="FRBRExpression"]/*[local-name()="FRBRuri"]/@value', | ||
xml))[1]::text) STORED NOT NULL; | ||
|
||
ALTER TABLE norms RENAME COLUMN eli_work TO eli_dokument_work; | ||
ALTER TABLE norms | ||
ADD COLUMN eli_norm_work text GENERATED ALWAYS AS ((xpath( | ||
'//*[local-name()="act"]/*[local-name()="meta"]/*[local-name()="identification"]/*[local-name()="FRBRWork"]/*[local-name()="FRBRuri"]/@value', | ||
xml))[1]::text) STORED NOT NULL; |
Oops, something went wrong.