Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

feat(mysql): try creating database if not exist #279

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Sep 17, 2017

  1. style: order imports lexicographically

    Best-practise according to `gofmt`.
    JensRantil committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    51acd3f View commit details
    Browse the repository at this point in the history
  2. style(cassandra): whitespace fixes

    According to `gofmt`.
    JensRantil committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    701bd68 View commit details
    Browse the repository at this point in the history
  3. sty: avoid unnecessary parenthesis

    Golang best-practise. Cleanup made by `gofmt`.
    JensRantil committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    d25732a View commit details
    Browse the repository at this point in the history
  4. feat(mysql): try creating database if not exist

    **Background:** Our scenario is that we'd like to be able to create schema from scratch
    for a brand new staging environment. This new staging environment
    doesn't have the database created.
    
    **Problem:** Having a first migration doing `CREATE DATABASE xxx`
    doesn't work because a connection to `mysql://tcp(a.b.c.d)/xxx` fails
    when database driver is trying to switch to the database `xxx`.
    
    **Proposed solution:** When `Open(...)`ing a MySQL `Driver`, we always
    try to create the database if it doesn't exist and _then_ we reestablish
    a new database connection and ask the MySQL `database/sql/driver.Driver`
    to make the switch to the database.
    JensRantil committed Sep 17, 2017
    Configuration menu
    Copy the full SHA
    da9a5dd View commit details
    Browse the repository at this point in the history