Closed drnic closed 6 years ago
There is a patch release going out this evening to fix this issue.
In the https://github.com/gobuffalo/gothrecipe project I get a different error:
buffalo db migrate
works as expected:
$ buffalo db migrate
v4.5.10
> create_users
> create_widgets
0.1183 seconds
dumped schema for gothrecipe_development
But bin/gothrecipe migrate
fails:
$ buffalo db drop -a
$ buffalo db create -a
$ buffalo build
$ bin/gothrecipe migrate
panic: sql: Register called twice for driver postgres
goroutine 1 [running]:
database/sql.Register(0x1a801bb, 0x8, 0x1c2cf00, 0x2118128)
/usr/local/Cellar/go/1.10.3/libexec/src/database/sql/sql.go:50 +0x1a4
github.com/gobuffalo/gothrecipe/vendor/github.com/lib/pq.init.0()
/Users/drnic/Projects/gopath/src/github.com/gobuffalo/gothrecipe/vendor/github.com/lib/pq/conn.go:49 +0x5c
@markbates ah awesome
Nope, sorry, that’s another issue that has been fixed. I’m on my phone and can’t find the details though. Sorry.
Nope, sorry again. You at piggy backing on another issue and I got confused. The patch tonight will fix the sub issue. Please use new ones on the future. I’m easily confused. :)
I'll move it to a new issue
Fixed with #1126
I upgraded to v0.12.1 and this problem still exists.
$ buffalo update
$ git diff
+++ b/Gopkg.lock
@@ -64,8 +64,8 @@
[[projects]]
name = "github.com/gobuffalo/buffalo"
packages = [".","binding","middleware","middleware/csrf","middleware/i18n","render","servers","worker"]
- revision = "7dd791f448a9ff897c3f63e2fc2008b184098c02"
- version = "v0.12.0"
+ revision = "9182ee5fe475fd22261e35b0eec09552a7860514"
+ version = "v0.12.1"
$ buffalo db drop -a
$ buffalo db create -a
$ buffalo build
$ bin/* migrate
DEBU[2018-06-22T11:57:18+10:00] CREATE TABLE "schema_migration" (
"version" VARCHAR (255) NOT NULL
);
CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version);
DEBU[2018-06-22T11:57:18+10:00] select count(*) as row_count from (SELECT schema_migration.* FROM schema_migration AS schema_migration WHERE version = $1) a $1="20180621060932"
0.0703 seconds
2018/06/22 11:57:18 Failed to run migrations: error processing 20180621060932_create_users.up.fizz: could not fizz the migration 20180621060932_create_users.up.fizz: parse error: function run error: function wants argument type fizz.Options but received type map[string]interface {}
Update: realised I hadn't run go get -u -v github.com/gobuffalo/buffalo
before buffalo build
. Trying that now.
Confirmed the issue persists after updating buffalo
CLI project; and running buffalo update
.
On the plus side? The #1124 issue is resolved; but now for gothrecipe project I get this #1123 issue as well:
$ bin/gothrecipe migrate
DEBU[2018-06-22T12:03:00+10:00] CREATE TABLE "schema_migration" (
"version" VARCHAR (255) NOT NULL
);
CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version);
DEBU[2018-06-22T12:03:00+10:00] select count(*) as row_count from (SELECT schema_migration.* FROM schema_migration AS schema_migration WHERE version = $1) a $1="20170629182437"
0.2023 seconds
2018/06/22 12:03:00 Failed to run migrations: error processing 20170629182437_create_users.up.fizz: could not fizz the migration 20170629182437_create_users.up.fizz: parse error: function run error: function wants argument type fizz.Options but received type map[string]interface {}
@markbates you ok to re-open this issue? Or want me to recreate it? I'm blocked from deploying to prod using a binary. I'm not sure of the nature of the problem to help debugging. Tips?
@drnic please recreate; I've completely lost track in this one. :)
Steps to Reproduce the Problem
Please describe in painful detail what you did (so others can play along with you) to get to this point. This includes things like the exact command(s) you used, or the
curl
command you used, that sort of thing.buffalo create -a && buffalo db migrate
works as expected and the app runs finebuffalo drop -a && buffalo build && bin/buffalo_testapp migrate
failsExpected Behavior
Migrations should have run.
Actual Behavior
Info