Skip to content

Commit efdd655

Browse files
authored
[AN-257] Update mysql version to 5.7 (#4804)
1 parent f3abaed commit efdd655

File tree

11 files changed

+61
-28
lines changed

11 files changed

+61
-28
lines changed

.github/workflows/unit_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
services:
2323
mysql:
24-
image: mysql/mysql-server:5.6
24+
image: mysql:5.7
2525
env:
2626
MYSQL_ROOT_PASSWORD: leonardo-test
2727
MYSQL_USER: leonardo-test

docker/run-mysql.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
# The CloudSQL console simply states "MySQL 5.6" so we may not match the minor version number
4-
MYSQL_VERSION=5.6
3+
# The CloudSQL console simply states "MySQL 5.7" so we may not match the minor version number
4+
MYSQL_VERSION=5.7
55
start() {
66

77
echo "attempting to remove old $CONTAINER container..."
@@ -17,7 +17,7 @@ start() {
1717
-e MYSQL_DATABASE=leotestdb \
1818
-d \
1919
-p 3311:3306 \
20-
mysql/mysql-server:$MYSQL_VERSION
20+
mysql:$MYSQL_VERSION
2121

2222
# validate mysql
2323
echo "running mysql validation..."
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<databaseChangeLog logicalFilePath="leonardo" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
33
<changeSet logicalFilePath="leonardo" author="kumra" id="cluster-createdDate-default">
4+
<validCheckSum>8:c1023fe139609a1cab82cda7caededc0</validCheckSum>
5+
<comment>
6+
Mysql 5.7+ cannot add a not null constraint with a default value simultaneously. This changeSet has been modified to reflect that; the
7+
validCheckSum is the checksum from when the table was not altered, but with addNotNullConstraint and addDefaultValue.
8+
</comment>
49
<sql dbms="mysql">ALTER TABLE CLUSTER
5-
CHANGE createdDate createdDate TIMESTAMP(6) NOT NULL DEFAULT 0</sql>
10+
CHANGE createdDate createdDate TIMESTAMP(6) NOT NULL DEFAULT "1970-01-01 00:00:01.000000"</sql>
611
</changeSet>
712
</databaseChangeLog>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<databaseChangeLog logicalFilePath="leonardo" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
33
<changeSet logicalFilePath="leonardo" author="vkumra" id="cluster_destroyeddate_not_null">
4-
<addNotNullConstraint columnDataType="TIMESTAMP(6)"
5-
columnName="destroyedDate"
6-
defaultNullValue="1970-01-01 00:00:01.000000"
7-
tableName="CLUSTER"/>
8-
<addDefaultValue columnDataType="TIMESTAMP(6)"
9-
columnName="destroyedDate"
10-
defaultValue="1970-01-01 00:00:01.000000"
11-
tableName="CLUSTER"/>
4+
<validCheckSum>8:29280ede1de44e4c3f2966c6922e9865</validCheckSum>
5+
<comment>
6+
Mysql 5.7+ changed default time stamps. This changeSet has been modified to reflect that; the
7+
validCheckSum is the checksum from when the default was 0.
8+
</comment>
9+
<sql>
10+
ALTER TABLE CLUSTER MODIFY COLUMN destroyedDate TIMESTAMP(6) NOT NULL DEFAULT '1970-01-01 00:00:01.000000';
11+
</sql>
1212
</changeSet>
1313
</databaseChangeLog>

http/src/main/resources/org/broadinstitute/dsde/workbench/leonardo/liquibase/changesets/20180515_cluster_dateaccessed.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
</changeSet>
1414

1515
<changeSet id="make dateAccessed not null" author="vkumra">
16-
<addNotNullConstraint columnDataType="TIMESTAMP(6)"
17-
columnName="dateAccessed"
18-
tableName="CLUSTER"/>
16+
<validCheckSum>8:5017000ff29d7873815c1bdb69895225</validCheckSum>
17+
<comment>
18+
Mysql 5.7+ cannot add a not null constraint with a default value simultaneously. This changeSet has been modified to reflect that; the
19+
validCheckSum is the checksum from when the table was not altered, but with addNotNullConstraint and addDefaultValue.
20+
</comment>
21+
<sql>ALTER TABLE CLUSTER MODIFY COLUMN dateAccessed TIMESTAMP(6) NOT NULL DEFAULT '1970-01-01 00:00:01.000000'</sql>
1922
</changeSet>
2023
</databaseChangeLog>

http/src/main/resources/org/broadinstitute/dsde/workbench/leonardo/liquibase/changesets/20200427_create_persistent_disk_table.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<databaseChangeLog logicalFilePath="leonardo" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
33
<changeSet logicalFilePath="leonardo" author="rtitle" id="persistent-disk-table">
4+
<validCheckSum>8:6e2afa6af8c562abad1e253e74d79817</validCheckSum>
5+
<comment>
6+
Mysql 5.7+ changed default time stamps. This changeSet has been modified to reflect that; the
7+
validCheckSum is the checksum from when the default was not set.
8+
</comment>
49
<createTable tableName="PERSISTENT_DISK">
510
<column name="id" type="BIGINT" autoIncrement="true">
611
<constraints primaryKey="true"/>
@@ -26,13 +31,13 @@
2631
<column name="creator" type="VARCHAR(255)">
2732
<constraints nullable="false"/>
2833
</column>
29-
<column name="createdDate" type="TIMESTAMP(6)">
34+
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
3035
<constraints nullable="false"/>
3136
</column>
32-
<column name="destroyedDate" type="TIMESTAMP(6)">
37+
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
3338
<constraints nullable="false"/>
3439
</column>
35-
<column name="dateAccessed" type="TIMESTAMP(6)">
40+
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
3641
<constraints nullable="false"/>
3742
</column>
3843
<column name="sizeGb" type="INT">

http/src/main/resources/org/broadinstitute/dsde/workbench/leonardo/liquibase/changesets/20200501_kubernetes_tables.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<databaseChangeLog logicalFilePath="leonardo" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
33

44
<changeSet logicalFilePath="leonardo" author="jcanas" id="kubernetes_cluster_table">
5+
<validCheckSum>8:599d13c602bc3a23e12dc577a848456f</validCheckSum>
6+
<comment>
7+
Mysql 5.7+ changed default time stamps. This changeSet has been modified to reflect that; the
8+
validCheckSum is the checksum from when the default was 0000-00-00 00:00:00.000000.
9+
</comment>
510
<createTable tableName="KUBERNETES_CLUSTER">
611
<column name="id" type="BIGINT" autoIncrement="true">
712
<constraints primaryKey="true"/>
@@ -27,13 +32,13 @@
2732
<column name="creator" type="VARCHAR(254)">
2833
<constraints nullable="false"/>
2934
</column>
30-
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
35+
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
3136
<constraints nullable="false"/>
3237
</column>
3338
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
3439
<constraints nullable="false"/>
3540
</column>
36-
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
41+
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
3742
<constraints nullable="false"/>
3843
</column>
3944
<column name="apiServerIp" type="VARCHAR(254)"/>
@@ -45,6 +50,11 @@
4550
</changeSet>
4651

4752
<changeSet logicalFilePath="leonardo" id="nodepool_table" author="jcanas">
53+
<validCheckSum>8:854fccdae58bc9906a94269397f04ae3</validCheckSum>
54+
<comment>
55+
Mysql 5.7+ changed default time stamps. This changeSet has been modified to reflect that; the
56+
validCheckSum is the checksum from when the default was 0000-00-00 00:00:00.000000.
57+
</comment>
4858
<createTable tableName="NODEPOOL">
4959
<column name="id" type="BIGINT" autoIncrement="true">
5060
<constraints primaryKey="true"/>
@@ -61,13 +71,13 @@
6171
<column name="creator" type="VARCHAR(254)">
6272
<constraints nullable="false"/>
6373
</column>
64-
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
74+
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
6575
<constraints nullable="false"/>
6676
</column>
6777
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
6878
<constraints nullable="false"/>
6979
</column>
70-
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
80+
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
7181
<constraints nullable="false"/>
7282
</column>
7383
<column name="machineType" type="VARCHAR(254)">

http/src/main/resources/org/broadinstitute/dsde/workbench/leonardo/liquibase/changesets/20200520_kubernetes_refactor.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
</changeSet>
2020

2121
<changeSet logicalFilePath="leonardo" id="kubernetes_add_app_tables" author="jcanas">
22+
<validCheckSum>8:a2cec6057088736af10dcdc3c2dd3091</validCheckSum>
23+
<comment>
24+
Mysql 5.7+ changed default time stamps. This changeSet has been modified to reflect that; the
25+
validCheckSum is the checksum from when the default was 0000-00-00 00:00:00.000000.
26+
</comment>
2227
<createTable tableName="APP">
2328
<column name="id" type="BIGINT" autoIncrement="true">
2429
<constraints primaryKey="true"/>
@@ -41,13 +46,13 @@
4146
<column name="creator" type="VARCHAR(254)">
4247
<constraints nullable="false"/>
4348
</column>
44-
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
49+
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
4550
<constraints nullable="false"/>
4651
</column>
4752
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
4853
<constraints nullable="false"/>
4954
</column>
50-
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
55+
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
5156
<constraints nullable="false"/>
5257
</column>
5358
<column name="namespaceId" type="BIGINT">

http/src/main/resources/org/broadinstitute/dsde/workbench/leonardo/liquibase/changesets/20230911_create_app_usage_table.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<databaseChangeLog logicalFilePath="leonardo" xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
33
<changeSet logicalFilePath="leonardo" author="qi" id="qi_create_app_usage_table">
4+
<validCheckSum>8:10d891c4c811215803753f8b060621be</validCheckSum>
5+
<comment>
6+
Mysql 5.7+ changed default time stamps. This changeSet has been modified to reflect that; the
7+
validCheckSum is the checksum from when the default was 0000-00-00 00:00:00.000000.
8+
</comment>
49
<createTable tableName="APP_USAGE">
510
<column name="id" type="BIGINT" autoIncrement="true">
611
<constraints primaryKey="true"/>
712
</column>
813
<column name="appId" type="BIGINT(20)">
914
<constraints nullable="false"/>
1015
</column>
11-
<column name="startTime" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
16+
<column name="startTime" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
1217
<constraints nullable="false"/>
1318
</column>
1419
<column name="stopTime" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">

http/src/test/resources/reference.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mysql {
3737
port = 3311
3838
db {
3939
driver = "com.mysql.cj.jdbc.Driver"
40-
url = "jdbc:mysql://"${mysql.host}":"${mysql.port}"/leotestdb?createDatabaseIfNotExist=true&useSSL=false&rewriteBatchedStatements=true&nullNamePatternMatchesAll=true"
40+
url = "jdbc:mysql://"${mysql.host}":"${mysql.port}"/leotestdb?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useSSL=false&rewriteBatchedStatements=true&nullNamePatternMatchesAll=true"
4141
user = "leonardo-test"
4242
password = "leonardo-test"
4343
connectionTimeout = "5 seconds" // default of 1 sec sometimes too short for docker local mysql

0 commit comments

Comments
 (0)