Skip to content

Commit

Permalink
Modify driver to plugin in docs for MySQL (uber#2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Singh authored and longquanzheng committed Dec 13, 2019
1 parent 34f4f6c commit 1e63e93
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config/development_mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ persistence:
maxConnLifetime: "1h"
mysql-visibility:
sql:
driverName: "mysql"
pluginName: "mysql"
databaseName: "cadence_visibility"
connectAddr: "127.0.0.1:3306"
connectProtocol: "tcp"
Expand Down
2 changes: 1 addition & 1 deletion docs/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ persistence:
datastores:
datastore1:
sql:
driverName: "mysql" -- name of the go sql driver, mysql is the only supported driver today
pluginName: "mysql" -- name of the go sql driver, mysql is the only supported driver today
databaseName: "cadence" -- name of the database to connect to
connectAddr: "127.0.0.1:3306" -- connection address, could be ip address or domain socket
connectProtocol: "tcp" -- connection protocol, tcp or anything that SQL Data Source Name accepts
Expand Down
22 changes: 11 additions & 11 deletions tools/sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ SQL_USER=$USERNAME SQL_PASSWORD=$PASSWD make install-schema-mysql
- For other SQL database, you can add it easily as we do for MySQL/Postgres following our code in sql-extensions

### Do one time database creation and schema setup for a new cluster
- All command below are taking MySQL as example. For postgres, simply use with "--driver postgres"
- All command below are taking MySQL as example. For postgres, simply use with "--plugin postgres"

```
cadence-sql-tool --ep $SQL_HOST_ADDR -p $port create --driver mysql --db cadence
cadence-sql-tool --ep $SQL_HOST_ADDR -p $port create --driver mysql --db cadence_visibility
cadence-sql-tool --ep $SQL_HOST_ADDR -p $port create --plugin mysql --db cadence
cadence-sql-tool --ep $SQL_HOST_ADDR -p $port create --plugin mysql --db cadence_visibility
```

```
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence update-schema -d ./schema/mysql/v57/cadence/versioned -- upgrades your schema to the latest version
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence update-schema -d ./schema/mysql/v57/cadence/versioned -- upgrades your schema to the latest version
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence_visibility setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0 for visibility
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence_visibility update-schema -d ./schema/mysql/v57/visibility/versioned -- upgrades your schema to the latest version for visibility
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence_visibility setup-schema -v 0.0 -- this sets up just the schema version tables with initial version of 0.0 for visibility
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence_visibility update-schema -d ./schema/mysql/v57/visibility/versioned -- upgrades your schema to the latest version for visibility
```

### Update schema as part of a release
You can only upgrade to a new version after the initial setup done above.

```
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -y -- executes a dryrun of upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -- actually executes the upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -y -- executes a dryrun of upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -- actually executes the upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence_visibility update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -y -- executes a dryrun of upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --driver mysql --db cadence_visibility update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -- actually executes the upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence_visibility update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -y -- executes a dryrun of upgrade to version x.x
./cadence-sql-tool --ep $SQL_HOST_ADDR -p $port --plugin mysql --db cadence_visibility update-schema -d ./schema/mysql/v57/cadence/versioned -v x.x -- actually executes the upgrade to version x.x
```

0 comments on commit 1e63e93

Please sign in to comment.