cloudspannerecosystem/wrench

Unable to perform migration using GENERATE_UUID()

Closed this issue · 1 comments

Expected Behavior

Creating a migration file using GENERATE_UUID() should be successful.
The use of GENERATE_UUID() should be available.
https://cloud.google.com/spanner/docs/primary-key-default-value#universally_unique_identifier_uuid

Current Behavior

Fails with errors like:

Error command: up, version: 1.6.0
        failed to parse DDL/DML statements: 000001.sql:2: got "(" while expecting ")", 000001.sql:1.0: unknown DML statement

Steps to Reproduce

  1. Create the database using wrench:
wrench create --directory ./schema
  1. Create a new migration file:
wrench migrate create --directory ./schema

# cat ./schema/migrations/000001.sql
CREATE TABLE test (
    test_id STRING(36) NOT NULL DEFAULT (GENERATE_UUID())
);
  1. Run migration:
wrench migrate up --directory ./schema

Context (Environment)

  • wrench version: 1.6.0

Solved to v1.7.0.
Thank you for updated!