Commit Graph

89 Commits (46ae6620981061da6c0e17df30c59a69fa2e6ac3)

Author SHA1 Message Date
R0masik fa06062cdc
fix: return joined err when try to get migrations list (#862) 2025-02-03 20:44:39 -05:00
Michael Fridman 6d0de39c50
feat: Add NewGoMigration constructor (#631) 2023-11-03 22:11:27 -04:00
Michael Fridman 20a99fa243
feat: Expose setter for global Go migration registry (#625) 2023-10-28 16:21:26 -04:00
Michael Fridman 7011525591
fix: collect go migrations (#588) 2023-08-27 11:31:40 -04:00
Michael Fridman 5c84746880
fix: AddMigrationNoTxContext invalid filename (#572) 2023-07-22 12:17:22 -04:00
José Neves 928f577129
refactor: filter registered Go migrations by fs dirpath (#553) 2023-07-11 09:16:37 -04:00
Ori Shalom e18fac6930
feat: add context-aware Go migrations (#534) 2023-06-29 16:15:39 -04:00
Craig Pastro 7d9fbafd99
fix: return error when no migration files are found or dir is not a directory (#539) 2023-06-29 15:48:50 -04:00
Ori Shalom 7dcddde25a
feat: expose new functions for setting context (#517) 2023-06-16 09:34:33 -04:00
Michael Fridman 87592390b9
fix: use global table name in queries (#515) 2023-05-08 08:17:14 -04:00
Andreas Deininger 15ef2bcb6e
chore: fix comment typos (#480) 2023-03-14 20:01:38 -04:00
Michael Fridman c462979327
refactor: create a generic store and stub out dialect queries (#477) 2023-03-14 08:34:47 -04:00
ipoerner b62288d2fe
fix: exclude Go test files from migrations (#474) 2023-03-04 12:48:57 -05:00
Michael Fridman 32ad603fee
Add golangci-lint and fix errors (#456) 2023-01-27 08:30:31 -05:00
Michael Fridman 203277344b
feat: add support for `*sql.DB`-registered Go migration (#450) 2023-01-25 08:15:50 -05:00
Sasha Melentyev 81d44b3095
refactor: Use math.MaxInt64 const as MaxVersion instead of hardcode number (#441)
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>

Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2023-01-18 08:47:50 -05:00
Michael Fridman f3d569f61b
Remove pkg/errors in favor of std lib (#373) 2022-06-22 21:36:07 -04:00
Zeal Wierslee 33487e40af
Make NumericComponent errors more understandable (#334) 2022-04-29 10:22:52 -04:00
Vladimir Stolyarov 3ffdd78efc
Embed support: add 'base' filesystem to discover migrations. (#244)
This needed to use go 1.16 'embed' feature.
By default, migrations discovered from os filesystem.
This can be changed using `SetBaseFS` method.
2021-08-19 09:21:29 -04:00
Tristan Fisher 8c026ee7c1 does not exists -> does not exist 2020-04-18 22:47:35 -04:00
Keiichi Hirobe ff01d6bdb6 Glob not support **. Change from ** to * to avoid confusion 2020-02-17 01:27:37 +09:00
Vojtech Vitek 1a52cca438 Remove log.Fatal() calls from the goose pkg
Fixes #76
2019-03-04 20:41:47 -05:00
Vojtech Vitek ea492665ca Add missing error check 2019-03-04 19:42:35 -05:00
1vn 22d96449ec remove db fix, unexport stuff 2018-10-30 17:02:57 -04:00
1vn 45eeb19d7d add fix and timestamp default 2018-10-30 16:45:45 -04:00
Nick Krichevsky 90e476692d
Update documentation for GetDBVersion to match functionality 2018-05-16 21:46:21 -04:00
Vojtech Vitek 95600eb369
Merge pull request #104 from chapsuk/table_name
Added ability to change db version table name
2018-05-03 11:24:55 -04:00
Maxim Krasilnikov 1cebce80c7 Added logger interface and SetLogger func for redefine package output 2018-04-30 12:30:13 +03:00
Maxim Krasilnikov 0639337e0b Added ability to change db version table name 2018-04-29 14:14:14 +03:00
tsctao 0aec7f101d Add error if migration directory does not exist 2017-07-09 16:56:11 +07:00
Vojtech Vitek a26643fb2b Fix migrations w/o TX, refactor 2017-06-20 16:30:29 -04:00
Vojtech Vitek d10e0e5458 Fix panic 2017-06-20 15:00:29 -04:00
Vojtech Vitek 28a7ddbabe Create command reads .go files from FS
Fixes #54
2017-06-20 14:55:23 -04:00
Nicholas Duffy abb2957c5d Update formatting per PR comments
Also rename `VersionId` to `VersionID`
2017-05-08 11:01:48 -06:00
Nicholas Duffy 5ee045e0f9 Merge branch 'master' into gofmt 2017-05-08 10:58:07 -06:00
Nicholas Duffy 2a9c8a91b9 Fix globbing for files in subdirectories
The glob `/**/*.sql` was looking for files in subdirectories
only and not finding SQL files in the root directory.

Now making two globs and combining the slices.
2017-05-07 07:17:09 -06:00
Nicholas Duffy fc368fe618 Reformat code to adhere to gofmt standards 2017-05-07 07:02:54 -06:00
Nicholas Duffy 0d5a6db9db Update CollectMigrations for subdirectories
I like to group my migrations by logical subdirectories.

```
[nicholasduffy@duffn:~/go/src/github.com/pressly/goose/migrations on sql-subdirectories]
% tree                                                                                                                                              ✭
.
├── group1
│   └── 20170506073854_table1_create_table.sql
└── group2
    └── 20170506073920_table2_create_table.sql

2 directories, 2 files
```

It's easy to run migrations by groups if necessary. However, I'd like the
ability to run all migrations in all subdirectories at the same time. This
PR adds discovery of all SQL files in subdirectories within the `-dir`
directory.
2017-05-06 08:04:19 -06:00
mmatczuk a66174eb9e Avoid panic in EnsureDBVersion 2017-04-05 12:32:40 +02:00
Vojtech Vitek 99e29546ba Merge pull request #22 from mmatczuk/mmt/export_collect_migrations
Rename collectMigrations to CollectMigrations
2017-03-27 11:21:09 -04:00
Przemyslaw Dobrowolski 9fc6f5207a Add support for adding migrations with custom filenames 2017-03-27 16:12:33 +02:00
mmatczuk 1e8921d41c rename collectMigrations to CollectMigrations 2017-03-27 10:19:04 +02:00
Piotr Kozłowski da36030846 Support for migrating up/down to a specific version 2017-03-17 14:44:22 +01:00
Vojtech Vitek f9980cee25 Fix int overflow on go 1.8-beta1 2016-12-09 13:06:30 -05:00
Josh Fyne 8a6c2299f0 Fixes the tests 2016-10-07 16:12:18 -04:00
Vojtech Vitek (V-Teq) 643386c3a6 Refactor 2016-10-03 19:31:27 -04:00
Vojtech Vitek (V-Teq) f49670b2b4 Fix go migration up 2016-09-29 19:30:23 -04:00
Vojtech Vitek (V-Teq) 96680a8221 Better version duplicate check 2016-08-15 15:29:29 -04:00
Vojtech Vitek (V-Teq) 6a2ef004b5 More verbose panic on duplicate migrations 2016-08-15 14:22:11 -04:00
Vojtech Vitek (V-Teq) 52af0e6a35 Panic on duplicate migration version 2016-08-15 14:11:46 -04:00