Closed dtest closed 1 year ago
Creating a migration file to ALTER INDEX should succeed as per Spanner DDL docs
ALTER INDEX
Fails with errors like:
Error command: up, version: unknown failed to parse DDL/DML statements: <file>.sql:1.0: unknown DDL statement, <file>.sql:1.0: unknown DML statement
./schema/schema.sql
CREATE TABLE players ( playerUUID STRING(36) NOT NULL, player_name STRING(64) NOT NULL, email STRING(MAX) NOT NULL, password_hash BYTES(60) NOT NULL, is_logged_in BOOL, ) PRIMARY KEY(playerUUID); CREATE UNIQUE INDEX PlayerAuthentication ON players(email) STORING (password_hash);
wrench create --directory ./schema
wrench migrate create --directory ./schema # cat ./schema/migrations/000001.sql ALTER INDEX PlayerAuthentication ADD STORED COLUMN is_logged_in;
wrench migrate up --directory ./schema
The workaround is to drop index and recreate. But it'd be nice to have ALTER INDEX supported.
Expected Behavior
Creating a migration file to
ALTER INDEX
should succeed as per Spanner DDL docsCurrent Behavior
Fails with errors like:
Steps to Reproduce
./schema/schema.sql
:Context (Environment)
The workaround is to drop index and recreate. But it'd be nice to have
ALTER INDEX
supported.