def upgrade_model_storage(model)
name = self.name
properties = model.properties_with_subclasses(name)
if success = create_model_storage(model)
return properties
end
table_name = model.storage_name(name)
with_connection do |connection|
properties.map do |property|
schema_hash = property_schema_hash(property)
next if field_exists?(table_name, schema_hash[:name])
statement = alter_table_add_column_statement(connection, table_name, schema_hash)
command = connection.create_command(statement)
command.execute_non_query
property
end.compact
end
end