daichirata / hammer

🛠 hammer is a command-line tool to schema management for Google Cloud Spanner.
MIT License
84 stars 25 forks source link

Fix NUMERIC NOT NULL #60

Closed sonatard closed 5 months ago

sonatard commented 5 months ago

Fix #59

$ hammer diff spanner://projects/xxx/instances/yyy/databases/zzz schema.sql
ALTER TABLE Test ADD COLUMN A NUMERIC NOT NULL DEFAULT (0);
ALTER TABLE Test ALTER COLUMN A DROP DEFAULT;

Since spansql.NumericLiteral type does not exist in https://github.com/googleapis/google-cloud-go, I am using FloatLiteral instead.

daichirata commented 5 months ago

Thanks for the PR!