Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 #2

Merged
merged 6 commits into from
Jan 23, 2018
Merged

v2 #2

Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# MySQL Driver

### See [issue #1](https://github.com/mattes/migrate/issues/1#issuecomment-58728186) before using this driver!

* Runs migrations in transactions.
That means that if a migration fails, it will be safely rolled back.
* Tries to return helpful error messages.
* Stores migration version details in table ``schema_migrations``.
* Stores migration version details in table `schema_migrations`.
This table will be auto-generated.
* Safe to run concurrently (`schema_migrations` table is locked during migrations)

## Migrations SQL formatting

Each SQL statement MUST end with semicolon (;) FOLLOWED BY NEWLINE !
Whole migration will be executed inside transaction by default.
Place SQL between "-- TXBEGIN" and "-- TXEND" comments for custom transaction:
- you CAN have multiple separate transactions in single migration
- any SQL not wrapped into TXBEGIN - TXEND will be executed without transaction.
Add "-- NOTX" comment above all SQL to disable default transaction. NOTE:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably unify this with the existing -- disable_ddl_transaction in pg driver

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to keep this "directive" comments short to avoid potential misspelling, or we should add some prefix (like ++ in goose) to apply validations and throw error if user misspelled something

it's redundant when TXBEGIN/TXEND is used.

## Usage

Expand All @@ -27,6 +35,10 @@ The MySQL driver will set a TLS config if the following env variables are set:
- `MYSQL_CLIENT_KEY`
- `MYSQL_CLIENT_CERT`

__TODO: deprecate - library code should not rely on environment variables__


## Authors

* Matthias Kadenbach, https://github.com/mattes
* Joseph Buchma, https://github.com/josephbuchma
Loading