mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-11 23:50:04 +01:00
mysql: Create the schema_migrations table using latin1 charset (#172)
Force the `schema_migrations` table to be created with `latin1` character set, to fix the behavior of dbmate in MariaDB 10.1 and older (or MySQL 5.6 and older) when the system charset has more than 1 byte per character (e.g. utf8mb4) Closes #85
This commit is contained in:
parent
5b7e6cef18
commit
2950db7131
1 changed files with 1 additions and 1 deletions
|
|
@ -194,7 +194,7 @@ func (drv MySQLDriver) DatabaseExists(u *url.URL) (bool, error) {
|
|||
// CreateMigrationsTable creates the schema_migrations table
|
||||
func (drv MySQLDriver) CreateMigrationsTable(u *url.URL, db *sql.DB) error {
|
||||
_, err := db.Exec("create table if not exists schema_migrations " +
|
||||
"(version varchar(255) primary key)")
|
||||
"(version varchar(255) primary key) character set latin1 collate latin1_bin")
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue