Skip to content

Commit

Permalink
[AN-256] Update mysql version to 8.0 for unit test and local leo (#4802)
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBaldo authored Nov 22, 2024
1 parent 7bb0c3b commit eac42c2
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

services:
mysql:
image: mysql/mysql-server:5.6
image: mysql/mysql-server:8.0
env:
MYSQL_ROOT_PASSWORD: leonardo-test
MYSQL_USER: leonardo-test
Expand Down
4 changes: 2 additions & 2 deletions docker/run-mysql.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# The CloudSQL console simply states "MySQL 5.6" so we may not match the minor version number
MYSQL_VERSION=5.6
# The CloudSQL console simply states "MySQL 8.0" so we may not match the minor version number
MYSQL_VERSION=8.0
start() {

echo "attempting to remove old $CONTAINER container..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<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">
<changeSet logicalFilePath="leonardo" author="kumra" id="cluster-createdDate-default">
<sql dbms="mysql">ALTER TABLE CLUSTER
CHANGE createdDate createdDate TIMESTAMP(6) NOT NULL DEFAULT 0</sql>
CHANGE createdDate createdDate TIMESTAMP(6) NOT NULL DEFAULT "1970-01-01 00:00:01.000000"</sql>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
<changeSet logicalFilePath="leonardo" author="vkumra" id="cluster_destroyeddate_not_null">
<addNotNullConstraint columnDataType="TIMESTAMP(6)"
columnName="destroyedDate"
defaultNullValue="1970-01-01 00:00:01.000000"
tableName="CLUSTER"/>
<addDefaultValue columnDataType="TIMESTAMP(6)"
columnName="destroyedDate"
defaultValue="1970-01-01 00:00:01.000000"
tableName="CLUSTER"/>
<sql>
ALTER TABLE CLUSTER MODIFY COLUMN destroyedDate TIMESTAMP(6) NOT NULL DEFAULT '1970-01-01 00:00:01.000000';
</sql>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
</changeSet>

<changeSet id="make dateAccessed not null" author="vkumra">
<addNotNullConstraint columnDataType="TIMESTAMP(6)"
columnName="dateAccessed"
tableName="CLUSTER"/>
<sql>ALTER TABLE CLUSTER MODIFY COLUMN dateAccessed TIMESTAMP(6) NOT NULL DEFAULT '1970-01-01 00:00:01.000000'</sql>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
<column name="creator" type="VARCHAR(254)">
<constraints nullable="false"/>
</column>
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="apiServerIp" type="VARCHAR(254)"/>
Expand Down Expand Up @@ -61,13 +61,13 @@
<column name="creator" type="VARCHAR(254)">
<constraints nullable="false"/>
</column>
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="machineType" type="VARCHAR(254)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
<column name="creator" type="VARCHAR(254)">
<constraints nullable="false"/>
</column>
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="createdDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="destroyedDate" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="dateAccessed" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="namespaceId" type="BIGINT">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<column name="appId" type="BIGINT(20)">
<constraints nullable="false"/>
</column>
<column name="startTime" type="TIMESTAMP(6)" defaultValue="0000-00-00 00:00:00.000000">
<column name="startTime" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
<constraints nullable="false"/>
</column>
<column name="stopTime" type="TIMESTAMP(6)" defaultValue="1970-01-01 00:00:01.000000">
Expand Down
4 changes: 2 additions & 2 deletions http/src/test/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# -e MYSQL_USER=leonardo-test \
# -e MYSQL_PASSWORD=leonardo-test \
# -e MYSQL_DATABASE=leotestdb \
# -d -p 3311:3306 mysql/mysql-server:5.6
# -d -p 3311:3306 mysql/mysql-server:8.0

application {
leoGoogleProject = "leo-project"
Expand Down Expand Up @@ -37,7 +37,7 @@ mysql {
port = 3311
db {
driver = "com.mysql.cj.jdbc.Driver"
url = "jdbc:mysql://"${mysql.host}":"${mysql.port}"/leotestdb?createDatabaseIfNotExist=true&useSSL=false&rewriteBatchedStatements=true&nullNamePatternMatchesAll=true"
url = "jdbc:mysql://"${mysql.host}":"${mysql.port}"/leotestdb?createDatabaseIfNotExist=true&&allowPublicKeyRetrieval=true&useSSL=false&rewriteBatchedStatements=true&nullNamePatternMatchesAll=true"
user = "leonardo-test"
password = "leonardo-test"
connectionTimeout = "5 seconds" // default of 1 sec sometimes too short for docker local mysql
Expand Down
2 changes: 1 addition & 1 deletion leonardo-example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dataproc {
# Database connection information
mysql {
db {
url = "jdbc:mysql://YOUR_DB_HOST/leonardo?requireSSL=true&useSSL=true&rewriteBatchedStatements=true&nullNamePatternMatchesAll=true"
url = "jdbc:mysql://YOUR_DB_HOST/leonardo?allowPublicKeyRetrieval=true&useSSL=false&rewriteBatchedStatements=true&nullNamePatternMatchesAll=true"
user = "USER_NAME"
password = "PASSWORD"
}
Expand Down

0 comments on commit eac42c2

Please sign in to comment.