Issues

Issue #132 resolved

Problem with setting default values in migration for BIT(specific MySQL type)

Konstantin Uvarov
created an issue

I need set default value for Bit type I should use b'1' OR b'0' literals for MySQL. Next text in migration:

op.alter_column(users,
                'visible',
                existing_type=sqlalchemy.dialects.mysql.BIT(1),
                existing_nullable=False,
                new_column_name='pending',
                server_default="b'1'")

produces:

ALTER TABLE users CHANGE visible pending BIT(1) NOT NULL DEFAULT 'b'1'';

but we need:

ALTER TABLE users CHANGE visible pending BIT(1) NOT NULL DEFAULT b'1';

Comments (1)

  1. Log in to comment