-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(mariadb): revert the bootstrapping script.
- Loading branch information
1 parent
65bd398
commit c1632e2
Showing
3 changed files
with
35 additions
and
50 deletions.
There are no files selected for viewing
29 changes: 12 additions & 17 deletions
29
src/grate.mariadb/Bootstrapping/Sql/Baseline/up/02_create_scripts_run_table.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,17 +1,12 @@ | ||
IF NOT EXISTS (SELECT 1 | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE table_schema = DATABASE() AND `table_name` = '{{SchemaName}}_{{ScriptsRunTable}}' | ||
) THEN | ||
CREATE TABLE {{SchemaName}}_{{ScriptsRunTable}}( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
version_id BIGINT NULL, | ||
script_name varchar(255) NULL, | ||
text_of_script text NULL, | ||
text_hash varchar(512) NULL, | ||
one_time_script boolean NULL, | ||
entry_date timestamp NULL, | ||
modified_date timestamp NULL, | ||
entered_by varchar(50) NULL, | ||
CONSTRAINT PK_{{ScriptsRunTable}}_id PRIMARY KEY (id) | ||
); | ||
END IF; | ||
CREATE TABLE {{SchemaName}}_{{ScriptsRunTable}}( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
version_id BIGINT NULL, | ||
script_name varchar(255) NULL, | ||
text_of_script text NULL, | ||
text_hash varchar(512) NULL, | ||
one_time_script boolean NULL, | ||
entry_date timestamp NULL, | ||
modified_date timestamp NULL, | ||
entered_by varchar(50) NULL, | ||
CONSTRAINT PK_{{ScriptsRunTable}}_id PRIMARY KEY (id) | ||
) |
31 changes: 13 additions & 18 deletions
31
src/grate.mariadb/Bootstrapping/Sql/Baseline/up/03_create_scripts_run_errors_table.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,18 +1,13 @@ | ||
IF NOT EXISTS (SELECT 1 | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE table_schema = DATABASE() AND `table_name` = '{{SchemaName}}_{{ScriptsRunErrorsTable}}' | ||
) THEN | ||
CREATE TABLE {{SchemaName}}_{{ScriptsRunErrorsTable}}( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
repository_path varchar(255) NULL, | ||
version varchar(50) NULL, | ||
script_name varchar(255) NULL, | ||
text_of_script text NULL, | ||
erroneous_part_of_script text NULL, | ||
error_message text NULL, | ||
entry_date timestamp NULL, | ||
modified_date timestamp NULL, | ||
entered_by varchar(50) NULL, | ||
CONSTRAINT PK_{{ScriptsRunErrorsTable}}_id PRIMARY KEY (id) | ||
); | ||
END IF; | ||
CREATE TABLE {{SchemaName}}_{{ScriptsRunErrorsTable}}( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
repository_path varchar(255) NULL, | ||
version varchar(50) NULL, | ||
script_name varchar(255) NULL, | ||
text_of_script text NULL, | ||
erroneous_part_of_script text NULL, | ||
error_message text NULL, | ||
entry_date timestamp NULL, | ||
modified_date timestamp NULL, | ||
entered_by varchar(50) NULL, | ||
CONSTRAINT PK_{{ScriptsRunErrorsTable}}_id PRIMARY KEY (id) | ||
) |
25 changes: 10 additions & 15 deletions
25
src/grate.mariadb/Bootstrapping/Sql/Baseline/up/04_create_version_table.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,15 +1,10 @@ | ||
IF NOT EXISTS (SELECT 1 | ||
FROM INFORMATION_SCHEMA.TABLES | ||
WHERE table_schema = DATABASE() AND `table_name` = '{{SchemaName}}_{{VersionTable}}' | ||
) THEN | ||
CREATE TABLE {{SchemaName}}_{{VersionTable}}( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
repository_path varchar(255) NULL, | ||
version varchar(50) NULL, | ||
entry_date timestamp NULL, | ||
modified_date timestamp NULL, | ||
entered_by varchar(50) NULL, | ||
status varchar(50) NULL, | ||
CONSTRAINT PK_{{VersionTable}}_id PRIMARY KEY (id) | ||
); | ||
END IF; | ||
CREATE TABLE {{SchemaName}}_{{VersionTable}}( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
repository_path varchar(255) NULL, | ||
version varchar(50) NULL, | ||
entry_date timestamp NULL, | ||
modified_date timestamp NULL, | ||
entered_by varchar(50) NULL, | ||
status varchar(50) NULL, | ||
CONSTRAINT PK_{{VersionTable}}_id PRIMARY KEY (id) | ||
) |