Closed Olegt0rr closed 3 years ago
Can't change field type with aerich
class User(Model): id = CharField(max_length=32)
class User(Model): id = BigIntField()
tortoise.exceptions.OperationalError: column "id" cannot be cast automatically to type bigint HINT: You might need to specify "USING id::bigint".
ALTER TABLE "users" ALTER COLUMN "id" TYPE BIGINT;
ALTER TABLE "users" ALTER COLUMN "id" TYPE BIGINT USING id::bigint;
Fixed, thanks!
Can't change field type with aerich
Example
State 1
State 2
Run upgrade
How to fix
Bad line (from migration)
Good line