I made a custom object with call method and pass it like:
role_number = NextNumber()
class Role(Model):
id = fields.IntField(pk=True)
number = fields.IntField(default=role_number)
When I called "aerich migrate" it gives following error:
AttributeError: 'NextNumber' object has no attribute 'name'
When I impelemnt name attribute for the object, it generates following SQL code in file in /migrate folder (among other lines)
ALTER TABLE role MODIFY COLUMN number INT NOT NULL COMMENT 'Priority (ordering) of the role' DEFAULT '<function cogs.db_utils.NextNumber:<class \'cogs.roles.Role\'>:number>';
Obviously this leads to faililure of executing aerich upgrade command
I made a custom object with call method and pass it like:
When I called "aerich migrate" it gives following error: AttributeError: 'NextNumber' object has no attribute 'name'
When I impelemnt name attribute for the object, it generates following SQL code in file in /migrate folder (among other lines) ALTER TABLE
role
MODIFY COLUMNnumber
INT NOT NULL COMMENT 'Priority (ordering) of the role' DEFAULT '<function cogs.db_utils.NextNumber:<class \'cogs.roles.Role\'>:number>'; Obviously this leads to faililure of executing aerich upgrade command