CHECK CONSTRAINT syntax fails

Issue #464 resolved
Former user created an issue
This fails (sqlite3 SA 0.3.4):

from sqlalchemy import *

db = create_engine('sqlite:///test.db')
metadata = BoundMetaData(db)

tab = Table('x', metadata,
  Column('y', Integer, CheckConstraint('y=1')),
  Column('z', String(10))
)
tab.create()


The SQL it produces is:

create table x(
  y integer, check (y=1),
  z varchar(10)
)

the comma after 'integer' breaks it, i.e. the following sql works:

create table x(
  y integer check (y=1),
  z varchar(10)
)

Comments (1)

  1. Log in to comment