server_default doesn't accept boolean value

Issue #1403 resolved
Former user created an issue

SQLAlchemy refuses the following declaration:

    ok = Column(Boolean, nullable=False, default=False, server_default=False)

You have to use the following instead, but I'm not sure it's portable (and it's also less natural to type):

    ok = Column(Boolean, nullable=False, default=False, server_default="0")

Comments (4)

  1. Mike Bayer repo owner

    server defaults aren't portable period. Bind parameters can't be used in DDL and we don't handle formatting of literals - in most cases, basic string or integer defaults are all you can count on across databases - things like dates, booleans etc. are more sketchy. so I'd call this a "wontfix".

  2. Log in to comment