You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: