Pull requests

#9 Declined
Repository
ghthor ghthor
Branch
custom-migration-directory
Repository
liamstask liamstask
Branch
master

Enable custom migrations directory

Author
  1. Abigail Walthall
Reviewers
Description

Example

development:
    driver: postgres
    open: driver-params
    migrations: migrations-postgres

I've used gospec to implement the tests. I have keep commits for the implementation separate from commits creating specifications. If you don't like where gospec is heading I'll go back and rewrite the specs using native gotest style.

Reasons for doing this

I want to write a test suite for the backend specific SQL with the filesystem tree resembling this.

test
├── dbconf.example.yml
├── dbconf.yml
├── migrations-mymysql
│   └── 1_testTable.sql
└── migrations-postgres
    └── 1_testTable.sql

test/dbconf.yml

testing-mymysql:
    driver: mymysql
    open: goose-testing/ghthor/somethingsecret
    migrations: migrations-mymysql

testing-postgres:
    driver: postgres
    open: user=ghthor dbname=goose-testing sslmode=disable
    migrations: migrations-postgres

To implement the above I needed to customize the migrations directory to segment mysql from postgres syntax.

I also would like your

Edit: I hit tab+enter when trying to indent the code block, whoops ~_~

Comments (3)

  1. Liam Staskawicz repo owner

    Awesome - thanks so much for kickstarting this!

    I think I'd prefer to stick with the native testing pkg for now since that's what I'm most familiar with. Hopefully this isn't too much trouble to accommodate.

    Your proposed file tree for testing sounds good to me.

    I have a couple other minor comments that I'll make on individual commits.

    1. Abigail Walthall author

      I have no problems using the stock testing package, I just enjoy the readability of BDD style assertions/expectations. I'll write them up after we decide how to implement this feature as a command flag instead of a property in the yml config file.

      Happy to accommodate :)