cloudspannerecosystem / wrench

wrench - Schema management tool for Cloud Spanner -
MIT License
239 stars 46 forks source link

`ALTER CHANGE STREAMS name SET FOR ...` statements not supported #88

Closed gion-pop closed 1 year ago

gion-pop commented 1 year ago

Expected Behavior

Create/migration contains ALTER CHANGE STREAMS name SET FOR ... should succeed as per Spanner DDL docs

Current Behavior

Fails with errors like:

Error command: create, version: v1.5.0
    Failed to execute the operation to Cloud Spanner, schema.sql:9: got "\"FOR\"", expected OPTIONS

Steps to Reproduce

  1. Prepare file schema.sql, contents is below:
    
    CREATE TABLE User (
    ID STRING(MAX) NOT NULL,
    Name STRING(MAX) NOT NULL,
    Age INT64 NOT NULL
    ) PRIMARY KEY(ID);

CREATE CHANGE STREAM UserStream FOR User(Name);

ALTER CHANGE STREAM UserStream SET FOR User(Name, Age);



2. Run `wrench create`

## Context (Environment)

* wrench version: 1.5.0

<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->