Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soda v4.6.3 Fizz Back Tick Issues #198

Closed
emmercm opened this issue Aug 7, 2018 · 2 comments
Closed

Soda v4.6.3 Fizz Back Tick Issues #198

emmercm opened this issue Aug 7, 2018 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@emmercm
Copy link

emmercm commented Aug 7, 2018

Related issues:

Environment:

  • soda v4.6.3 installed fresh via go get and go install, as reported by soda --version and:

    cd $GOPATH/src/github.com/gobuffalo/pop
    git fetch
    git --no-pager log --max-count 5
  • github.com/gobuffalo/plush v3.7.11 as reported by:

    cd $GOPATH/src/github.com/gobuffalo/plush
    git fetch
    git --no-pager log --max-count 5

Ran with Travis CI with .travis.yml similar to:

language: go

services:
  - postgresql

addons:
  postgresql: "9.6"

go:
  - "1.10"

env:
  - DB_USER=postgres DB_PASSWORD=

before_install:
  - cp .netrc ~
  - chmod 600 .netrc

install:
  - go get github.com/gobuffalo/pop/...
  - go get github.com/golang/lint/golint
  - go get github.com/golang/dep/cmd/dep

  - cd $GOPATH/src/github.com/gobuffalo/pop
  - git fetch
  - git --no-pager log --max-count 5
  - cd $TRAVIS_BUILD_DIR
  - go install github.com/gobuffalo/pop/soda
  - soda --version
  - cd $GOPATH/src/github.com/gobuffalo/plush
  - git fetch
  - git --no-pager log --max-count 5
  - cd $TRAVIS_BUILD_DIR

before_script:
  - soda create -d -e test_database
  - soda migrate -d -e test_database

script:
  - dep ensure
  - go test ./... -v
  - go vet ./...
  - golint $(go list ./...)
  - go build

Only migration:

raw(`CREATE EXTENSION IF NOT EXISTS "uuid-ossp";`)

create_table("users", func(t) {
  t.Column("email", "string", {})
  t.Column("twitter_handle", "string", {"size": 50})
  t.Column("age", "integer", {"default": 0})
  t.Column("admin", "bool", {"default": false})
  t.Column("company_id", "uuid", {"default_raw": "uuid_generate_v1()"})
  t.Column("bio", "text", {"null": true})
  t.Column("joined_at", "timestamp", {})
})

raw(`
    INSERT INTO users (email, twitter_handle, joined_at, created_at, updated_at)
    VALUES ('JasonJSalgado@teleworm.us', 'Soman1994', now(), now(), now());
`)

Output:

[POP] 2018/08/07 18:31:39 CREATE TABLE "schema_migration" (
"version" VARCHAR (255) NOT NULL
);
CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version);
[POP] 2018/08/07 18:31:39 SELECT EXISTS (SELECT schema_migration.* FROM schema_migration AS schema_migration WHERE version = $1) | ["20180627164200"]
[WARN] migrations/20180627164200_back_quotes.up.fizz uses an old fizz syntax. please use
sql("CREATE EXTENSION IF NOT EXISTS "uuid-ossp";")
create_table("users") {
  t.Column("email", "string", {})
  t.Column("twitter_handle", "string", {"size": 50})
  t.Column("age", "integer", {"default": 0})
  t.Column("admin", "bool", {"default": false})
  t.Column("company_id", "uuid", {"default_raw": "uuid_generate_v1()"})
  t.Column("bio", "text", {"null": true})
  t.Column("joined_at", "timestamp", {})
}
sql("
    INSERT INTO users (email, twitter_handle, joined_at, created_at, updated_at)
    VALUES ('JasonJSalgado@teleworm.us', 'Soman1994', now(), now(), now());
")
0.0174 seconds
[POP] 2018/08/07 18:31:39 pg_dump -s --dbname=postgres://postgres:@localhost:5432/pricing_test?sslmode=disable
dumped schema for pricing_test
Error: error processing migrations/20180627164200_back_quotes.up.fizz: could not fizz the migration migrations/20180627164200_back_quotes.up.fizz: line 1: expected next token to be ), got IDENT instead
line 2: no prefix parse function for ) found
Usage:
  soda migrate [flags]
  soda migrate [command]
Aliases:
  migrate, m
Available Commands:
  down        Apply one or more of the 'down' migrations.
  reset       The equivalent of running `migrate down` and then `migrate up`
  status      Displays the status of all migrations.
  up          Apply all of the 'up' migrations.
Flags:
  -h, --help   help for migrate
Global Flags:
  -c, --config string   The configuration file you would like to use.
  -d, --debug           Use debug/verbose mode
  -e, --env string      The environment you want to run migrations against. Will use $GO_ENV if set. (default "development")
  -p, --path string     Path to the migrations folder (default "./migrations")
Use "soda migrate [command] --help" for more information about a command.
error processing migrations/20180627164200_back_quotes.up.fizz: could not fizz the migration migrations/20180627164200_back_quotes.up.fizz: line 1: expected next token to be ), got IDENT instead
line 2: no prefix parse function for ) found
@stanislas-m stanislas-m added the bug Something isn't working label Aug 12, 2018
@stanislas-m stanislas-m added this to the v4.6.3 milestone Aug 12, 2018
@stanislas-m
Copy link
Member

Should be fixed with v4.6.5.

@emmercm
Copy link
Author

emmercm commented Aug 16, 2018

Can confirmed fixed, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants