-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make view great again in test migration
- Loading branch information
Michael von Bargen
committed
Jun 18, 2024
1 parent
41be190
commit ffa02be
Showing
1 changed file
with
6 additions
and
11 deletions.
There are no files selected for viewing
17 changes: 6 additions & 11 deletions
17
.../src/test/resources/db/migrations/h2-postgresql/V0_0_15__jpa_view_correlation_payload.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,11 +1,6 @@ | ||
CREATE TABLE plf_view_task_and_data_entry_payload ( | ||
task_id VARCHAR(64) NOT NULL, | ||
path VARCHAR(255) NOT NULL, | ||
value VARCHAR(255) NOT NULL, | ||
PRIMARY KEY (task_id, path, value) | ||
); | ||
|
||
ALTER TABLE plf_view_task_and_data_entry_payload | ||
ADD CONSTRAINT FK_view_task_and_data_entry_payload_have_task | ||
FOREIGN KEY (task_id) | ||
REFERENCES plf_task; | ||
create view PLF_VIEW_TASK_AND_DATA_ENTRY_PAYLOAD as | ||
((select pc.TASK_ID, dea.PATH, dea.VALUE | ||
from PLF_TASK_CORRELATIONS pc | ||
join PLF_DATA_ENTRY_PAYLOAD_ATTRIBUTES dea on pc.ENTRY_ID = dea.ENTRY_ID and pc.ENTRY_TYPE = dea.ENTRY_TYPE) | ||
union | ||
select * from PLF_TASK_PAYLOAD_ATTRIBUTES); |