-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create MS SQL and MySQL database scripts #22
- Loading branch information
zaharchenko
committed
Apr 11, 2019
1 parent
8a53601
commit 6b1f712
Showing
10 changed files
with
236 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
-- begin EMAILTEMPLATES_PARAMETER_VALUE | ||
create table EMAILTEMPLATES_PARAMETER_VALUE ( | ||
ID uniqueidentifier, | ||
VERSION integer not null, | ||
CREATE_TS datetime2, | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime2, | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime2, | ||
DELETED_BY varchar(50), | ||
-- | ||
PARAMETER_TYPE integer not null, | ||
ALIAS varchar(255) not null, | ||
DEFAULT_VALUE varchar(255), | ||
TEMPLATE_PARAMETER_ID uniqueidentifier not null, | ||
-- | ||
primary key nonclustered (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_PARAMETER_VALUE | ||
-- begin EMAILTEMPLATES_TEMPLATE_GROUP | ||
create table EMAILTEMPLATES_TEMPLATE_GROUP ( | ||
ID uniqueidentifier, | ||
VERSION integer not null, | ||
CREATE_TS datetime2, | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime2, | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime2, | ||
DELETED_BY varchar(50), | ||
-- | ||
NAME varchar(255) not null, | ||
-- | ||
primary key nonclustered (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_TEMPLATE_GROUP | ||
-- begin EMAILTEMPLATES_EMAIL_TEMPLATE | ||
create table EMAILTEMPLATES_EMAIL_TEMPLATE ( | ||
ID uniqueidentifier, | ||
VERSION integer not null, | ||
CREATE_TS datetime2, | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime2, | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime2, | ||
DELETED_BY varchar(50), | ||
DTYPE varchar(100), | ||
-- | ||
USE_REPORT_SUBJECT tinyint, | ||
NAME varchar(255) not null, | ||
GROUP_ID uniqueidentifier, | ||
TYPE_ varchar(50) not null, | ||
CODE varchar(255) not null, | ||
FROM_ varchar(255), | ||
TO_ varchar(max), | ||
CC varchar(max), | ||
BCC varchar(max), | ||
SUBJECT varchar(255), | ||
-- | ||
-- from emailtemplates$ReportEmailTemplate | ||
EMAIL_BODY_REPORT_ID uniqueidentifier, | ||
-- | ||
-- from emailtemplates$JsonEmailTemplate | ||
HTML varchar(max), | ||
REPORT_XML varchar(max), | ||
-- | ||
primary key nonclustered (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_EMAIL_TEMPLATE | ||
-- begin EMAILTEMPLATES_TEMPLATE_REPORT | ||
create table EMAILTEMPLATES_TEMPLATE_REPORT ( | ||
ID uniqueidentifier, | ||
VERSION integer not null, | ||
CREATE_TS datetime2, | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime2, | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime2, | ||
DELETED_BY varchar(50), | ||
-- | ||
NAME varchar(255), | ||
REPORT_ID uniqueidentifier not null, | ||
EMAIL_TEMPLATE_ID uniqueidentifier, | ||
-- | ||
primary key nonclustered (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_TEMPLATE_REPORT | ||
-- begin EMAILTEMPLATES_EMLTPTE_FDLINK | ||
create table EMAILTEMPLATES_EMLTPTE_FDLINK ( | ||
EMAIL_TEMPLATE_ID uniqueidentifier, | ||
FILE_DESCRIPTOR_ID uniqueidentifier, | ||
primary key (EMAIL_TEMPLATE_ID, FILE_DESCRIPTOR_ID) | ||
)^ | ||
-- end EMAILTEMPLATES_EMLTPTE_FDLINK |
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,20 @@ | ||
-- begin EMAILTEMPLATES_PARAMETER_VALUE | ||
alter table EMAILTEMPLATES_PARAMETER_VALUE add constraint FK_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER foreign key (TEMPLATE_PARAMETER_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ | ||
create index IDX_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER on EMAILTEMPLATES_PARAMETER_VALUE (TEMPLATE_PARAMETER_ID)^ | ||
-- end EMAILTEMPLATES_PARAMETER_VALUE | ||
-- begin EMAILTEMPLATES_EMAIL_TEMPLATE | ||
alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP foreign key (GROUP_ID) references EMAILTEMPLATES_TEMPLATE_GROUP(ID)^ | ||
alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_EMAIL_BODY_REPORT foreign key (EMAIL_BODY_REPORT_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ | ||
create unique index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_UNIQ_CODE on EMAILTEMPLATES_EMAIL_TEMPLATE (CODE, DELETE_TS) ^ | ||
create index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP on EMAILTEMPLATES_EMAIL_TEMPLATE (GROUP_ID)^ | ||
-- end EMAILTEMPLATES_EMAIL_TEMPLATE | ||
-- begin EMAILTEMPLATES_TEMPLATE_REPORT | ||
alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT foreign key (REPORT_ID) references REPORT_REPORT(ID)^ | ||
alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ | ||
create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT on EMAILTEMPLATES_TEMPLATE_REPORT (REPORT_ID)^ | ||
create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE on EMAILTEMPLATES_TEMPLATE_REPORT (EMAIL_TEMPLATE_ID)^ | ||
-- end EMAILTEMPLATES_TEMPLATE_REPORT | ||
-- begin EMAILTEMPLATES_EMLTPTE_FDLINK | ||
alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ | ||
alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_FILE_DESCRIPTOR foreign key (FILE_DESCRIPTOR_ID) references SYS_FILE(ID)^ | ||
-- end EMAILTEMPLATES_EMLTPTE_FDLINK |
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 @@ | ||
|
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,93 @@ | ||
-- begin EMAILTEMPLATES_PARAMETER_VALUE | ||
create table EMAILTEMPLATES_PARAMETER_VALUE ( | ||
ID varchar(32), | ||
VERSION integer not null, | ||
CREATE_TS datetime(3), | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime(3), | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime(3), | ||
DELETED_BY varchar(50), | ||
-- | ||
PARAMETER_TYPE integer not null, | ||
ALIAS varchar(255) not null, | ||
DEFAULT_VALUE varchar(255), | ||
TEMPLATE_PARAMETER_ID varchar(32) not null, | ||
-- | ||
primary key (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_PARAMETER_VALUE | ||
-- begin EMAILTEMPLATES_TEMPLATE_GROUP | ||
create table EMAILTEMPLATES_TEMPLATE_GROUP ( | ||
ID varchar(32), | ||
VERSION integer not null, | ||
CREATE_TS datetime(3), | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime(3), | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime(3), | ||
DELETED_BY varchar(50), | ||
-- | ||
NAME varchar(255) not null, | ||
-- | ||
primary key (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_TEMPLATE_GROUP | ||
-- begin EMAILTEMPLATES_EMAIL_TEMPLATE | ||
create table EMAILTEMPLATES_EMAIL_TEMPLATE ( | ||
ID varchar(32), | ||
VERSION integer not null, | ||
CREATE_TS datetime(3), | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime(3), | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime(3), | ||
DELETED_BY varchar(50), | ||
DTYPE varchar(100), | ||
-- | ||
USE_REPORT_SUBJECT boolean, | ||
NAME varchar(255) not null, | ||
GROUP_ID varchar(32), | ||
TYPE_ varchar(50) not null, | ||
CODE varchar(255) not null, | ||
FROM_ varchar(255), | ||
TO_ longtext, | ||
CC longtext, | ||
BCC longtext, | ||
SUBJECT varchar(255), | ||
-- | ||
-- from emailtemplates$ReportEmailTemplate | ||
EMAIL_BODY_REPORT_ID varchar(32), | ||
-- | ||
-- from emailtemplates$JsonEmailTemplate | ||
HTML longtext, | ||
REPORT_XML longtext, | ||
-- | ||
primary key (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_EMAIL_TEMPLATE | ||
-- begin EMAILTEMPLATES_TEMPLATE_REPORT | ||
create table EMAILTEMPLATES_TEMPLATE_REPORT ( | ||
ID varchar(32), | ||
VERSION integer not null, | ||
CREATE_TS datetime(3), | ||
CREATED_BY varchar(50), | ||
UPDATE_TS datetime(3), | ||
UPDATED_BY varchar(50), | ||
DELETE_TS datetime(3), | ||
DELETED_BY varchar(50), | ||
-- | ||
NAME varchar(255), | ||
REPORT_ID varchar(32) not null, | ||
EMAIL_TEMPLATE_ID varchar(32), | ||
-- | ||
primary key (ID) | ||
)^ | ||
-- end EMAILTEMPLATES_TEMPLATE_REPORT | ||
-- begin EMAILTEMPLATES_EMLTPTE_FDLINK | ||
create table EMAILTEMPLATES_EMLTPTE_FDLINK ( | ||
EMAIL_TEMPLATE_ID varchar(32), | ||
FILE_DESCRIPTOR_ID varchar(32), | ||
primary key (EMAIL_TEMPLATE_ID, FILE_DESCRIPTOR_ID) | ||
)^ | ||
-- end EMAILTEMPLATES_EMLTPTE_FDLINK |
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,20 @@ | ||
-- begin EMAILTEMPLATES_PARAMETER_VALUE | ||
alter table EMAILTEMPLATES_PARAMETER_VALUE add constraint FK_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER foreign key (TEMPLATE_PARAMETER_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ | ||
create index IDX_EMAILTEMPLATES_PARAMETER_VALUE_TEMPLATE_PARAMETER on EMAILTEMPLATES_PARAMETER_VALUE (TEMPLATE_PARAMETER_ID)^ | ||
-- end EMAILTEMPLATES_PARAMETER_VALUE | ||
-- begin EMAILTEMPLATES_EMAIL_TEMPLATE | ||
alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP foreign key (GROUP_ID) references EMAILTEMPLATES_TEMPLATE_GROUP(ID)^ | ||
alter table EMAILTEMPLATES_EMAIL_TEMPLATE add constraint FK_EMAILTEMPLATES_EMAIL_TEMPLATE_EMAIL_BODY_REPORT foreign key (EMAIL_BODY_REPORT_ID) references EMAILTEMPLATES_TEMPLATE_REPORT(ID)^ | ||
create unique index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_UNIQ_CODE on EMAILTEMPLATES_EMAIL_TEMPLATE (CODE) ^ | ||
create index IDX_EMAILTEMPLATES_EMAIL_TEMPLATE_GROUP on EMAILTEMPLATES_EMAIL_TEMPLATE (GROUP_ID)^ | ||
-- end EMAILTEMPLATES_EMAIL_TEMPLATE | ||
-- begin EMAILTEMPLATES_TEMPLATE_REPORT | ||
alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT foreign key (REPORT_ID) references REPORT_REPORT(ID)^ | ||
alter table EMAILTEMPLATES_TEMPLATE_REPORT add constraint FK_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ | ||
create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_REPORT on EMAILTEMPLATES_TEMPLATE_REPORT (REPORT_ID)^ | ||
create index IDX_EMAILTEMPLATES_TEMPLATE_REPORT_EMAIL_TEMPLATE on EMAILTEMPLATES_TEMPLATE_REPORT (EMAIL_TEMPLATE_ID)^ | ||
-- end EMAILTEMPLATES_TEMPLATE_REPORT | ||
-- begin EMAILTEMPLATES_EMLTPTE_FDLINK | ||
alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_EMAIL_TEMPLATE foreign key (EMAIL_TEMPLATE_ID) references EMAILTEMPLATES_EMAIL_TEMPLATE(ID)^ | ||
alter table EMAILTEMPLATES_EMLTPTE_FDLINK add constraint FK_EMLF_FILE_DESCRIPTOR foreign key (FILE_DESCRIPTOR_ID) references SYS_FILE(ID)^ | ||
-- end EMAILTEMPLATES_EMLTPTE_FDLINK |
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 @@ | ||
|
Empty file.
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