问题
We are using azure table storage and have thousands of tables using the same schema. Now we are looking to add another column to these tables. How do we add another column to our existing tables without deleting the table and re-adding it?
回答1:
Windows Azure Table Storage doesn't actually have columns. Each entity (e.g. a Row) is simply a set of properties, with no fixed schema. If you're using a strongly-typed class to write to your table, then you just need to add your new property to that class.
For older rows that don't have the new property, the value in your class object will be set to its default value.
回答2:
Great answer from David Makogon above but just wanted to add one additional consideration.
Table Storage does not have a fixed schema as David states but, unfortunately, the dev storage emulator running on localhost does. The reason for this is that the emulator uses SQL server to store localhost data and it needs to create a schema for SQL purposes only. So if you are testing changes such as additional properties in your strongly types class, be prepared for your code changes not working in developer storage.
来源:https://stackoverflow.com/questions/8941958/how-to-add-a-new-column-to-an-existing-azure-table-storage