title: How to use mattes/migrate in golang?
body: <p>I've been trying to use the <a href="https://github.com/mattes/migrate" rel="nofollow noreferrer" title="mattes/migrate">mattes/migrate</a> package but I can't seem to get it to actually do anything. The database runs on postgres and I interact with it through <a href="https://github.com/jmoiron/sqlx" rel="nofollow noreferrer" title="sqlx">sqlx</a>.</p>
  
  <p>I've gone through the readme on github, and applied the following code:</p>
  
  <pre><code>// use synchronous versions of migration functions ...
  allErrors, ok := migrate.UpSync("postgres://&lt;my_url_string&gt;", "./app/database/migrations")
  if !ok {
    fmt.Println("Oh no ...")
    // do sth with allErrors slice
  }
  </code></pre>
  
  <p>My schema is initiated like this:</p>
  
  <pre><code>//sqlx's initiated DB is imported in the database package
  
  func SyncSchemas() {
    database.DB.MustExec(schema)
  }
  
  var schema =
    `CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
  
     CREATE TABLE IF NOT EXISTS examples (
       created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
       deleted_at text DEFAULT NULL,
       id UUID PRIMARY KEY UNIQUE NOT NULL DEFAULT uuid_generate_v4()
     );`
  
  type Example struct {
    ID            string      `json:"id" db:"id"`
    CreatedAt     time.Time   `json:"created_at" db:"created_at"`
    DeletedAt     *time.Time  `json:"deleted_at" db:"deleted_at"` 
  }
  </code></pre>
  
  <p>It runs without error, but that's all it seems to be doing at the moment. Shouldn't it keep track of my schemas or something? I previously used <a href="https://github.com/jinzhu/gorm" rel="nofollow noreferrer" title="gorm">gorm</a> as my ORM, and there I just had to run autoMigrate() on a schema and it automatically created and applied migrations as I changed the schema. I would like the same functionality with mattes/migrate, but I can't seem to find an example or tutorial which shows how to use it.</p>
  
  <p>How am I supposed to do this?</p>