Closed hound672 closed 3 years ago
I do, all the time. You might find a helper like this useful: https://github.com/rubenv/pgtest
On Wed, Nov 25, 2020, 07:19 Vasilii Bliznetsov notifications@github.com wrote:
Hello. Does anybody try to use this lib with unittests? Like Django, for example.
- Start unittest
- Up migrations for db
- Running unittest
- Down migrations
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rubenv/sql-migrate/issues/184, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAKPGHKSNSBNRA75LNLBQLSRSOXPANCNFSM4UB6DISA .
Thanks. But it does not up/down migrations.
No but it does provide you with a clean server to test against. Doing the up/down is just a matter of calling the library.
On Wed, Nov 25, 2020, 07:37 Vasilii Bliznetsov notifications@github.com wrote:
Thanks. But it does not up/down migrations.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rubenv/sql-migrate/issues/184#issuecomment-733500075, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAKPGEILGUOPUMD32PORLDSRSQ2DANCNFSM4UB6DISA .
I'd like to create db by my own.
For example, I have 2 environments in dbconfig.yml
:
Could I up/down migrations in golang unittests with this config (with testing
env)?
The config file is for the CLI tool, but you can do anything the CLI does with the library.
On Wed, Nov 25, 2020, 07:50 Vasilii Bliznetsov notifications@github.com wrote:
I'd like to create db by my own. For example, I have 2 environments in dbconfig.yml:
- testing
- develop with different credentials, db name etc.
Could I up/down migrations in golang unittests with this config (with testing env)?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rubenv/sql-migrate/issues/184#issuecomment-733505141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAKPGEQVYRXVKGAL6OPFFDSRSSK7ANCNFSM4UB6DISA .
Ok, thanks. I will try in this way.
Hello. Does anybody try to use this lib with unittests? Like Django, for example.