golang-migrate / migrate

Database migrations. CLI and Golang library.
Other
15.09k stars 1.39k forks source link

Errors parsing JSON_VALUE #671

Open kylechadha opened 2 years ago

kylechadha commented 2 years ago

Describe the Bug error: :3: got "(" while expecting ")" while parsing JSON_VALUE. This is an issue with the underlying Spanner parsing lib, which has been fixed in https://github.com/googleapis/google-cloud-go/pull/5173

Steps to Reproduce Attempt to run a migration with the following DDL:

ALTER TABLE products ADD COLUMN item STRING(MAX) AS (JSON_VALUE(itemDetails, '$.itemDetails')) STORED;

Expected Behavior No errors.

Migrate Version v4.5.1

Loaded Source Drivers e.g. s3, github, go-bindata, gcs, file Obtained by running: migrate -help

Loaded Database Drivers github, github-ee, go-bindata, gcs, s3, bitbucket, gitlab, godoc-vfs, file

Go Version go version go1.16.3 darwin/amd64

Stacktrace N/A

Additional context PR to fix: https://github.com/golang-migrate/migrate/pull/669

kylechadha commented 2 years ago

Linking PR: https://github.com/golang-migrate/migrate/pull/669