colopl / laravel-spanner

Laravel database driver for Google Cloud Spanner
Apache License 2.0
97 stars 16 forks source link

Add/alter columns should be separate statements #159

Closed matthewjumpsoffbuildings closed 11 months ago

matthewjumpsoffbuildings commented 11 months ago

In Google Cloud Spanner, you cannot add or alter multiple columns in a single DML statement. Instead, you need to execute separate ALTER TABLE statements for each column you want to add or modify.

The current implementation make a single statement

alter table `table` add column `column_one` string(max), add column `column_two` string(max);

This fix makes the correct statements

alter table `table` add column `column_one` string(max);
alter table `table` add column `column_two` string(max);
taka-oyama commented 11 months ago

Please add a summary to CHANGELOG. Thanks.