-
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.
improve(persistence): transactional behavior
- make predicition service participate in engine's transaction if present - enforce some constraints in database tables - perform database type check when creating tables - create tables only if not yet present
- Loading branch information
1 parent
dc38a51
commit a8d1f3b
Showing
17 changed files
with
304 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
CREATE TABLE PREDICTION_MODEL ( | ||
ID_ varchar(64) not null, | ||
NAME_ varchar(255) not null, -- add unique constraint | ||
NAME_ varchar(255) not null, | ||
RESOURCE_ longvarbinary, | ||
primary key (ID_) | ||
); | ||
|
||
CREATE TABLE PREDICTION_PRIOR ( | ||
MODEL_ID_ varchar(64) not null, -- make foreign key | ||
DESCRIBED_VARIABLE_ varchar(255) not null, -- make composite key with model_id | ||
DATA_ longvarbinary | ||
); | ||
MODEL_ID_ varchar(64) not null, | ||
DESCRIBED_VARIABLE_ varchar(255) not null, | ||
DATA_ longvarbinary, | ||
|
||
); | ||
|
||
alter table PREDICTION_MODEL | ||
add constraint PREDICTION_MODEL_NAME_UNIQUE | ||
unique (NAME_); | ||
|
||
alter table PREDICTION_PRIOR | ||
add constraint PREDICTION_PRIOR_MODEL_ID_FK | ||
foreign key (MODEL_ID_) | ||
references PREDICTION_MODEL (ID_); | ||
|
||
alter table PREDICTION_PRIOR | ||
add constraint PREDICTION_PRIOR_MODEL_VARIABLE_UNIQUE | ||
unique (MODEL_ID_, DESCRIBED_VARIABLE_); | ||
|
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
Oops, something went wrong.