Not sure if this is considered a bug, but the SQL output from sqlmigrate contains a small syntax error with default string values:
Add a new column as so:
class City(models.Model):
...
name = models.CharField(max_length=100, default='a b c d')
Create migration, and run sqlmigrate command:
BEGIN;
--
-- Add field name to city
--
ALTER TABLE `map_city` ADD COLUMN `name ` varchar(100) DEFAULT a b c d NOT NULL;
ALTER TABLE `map_city` ALTER COLUMN `name ` DROP DEFAULT;
COMMIT;
Notice 'a b c d' is missing quotes. When this migration is actually applied it runs through cursor.execute, which properly quotes the value.
I realize sqlmigrate is only for getting a preview of the SQL, but other parts like the table name and columns are correctly quoted, so why not the default?