- changed status to invalid
default=0 in Column statement should produce DEFAULT=0 in CREATE TABLE SQL statement
Table('test',meta, Column('Id', Integer, primary_key=True), Column('Name', String(60)), Column('Status', Integer, nullable=False, default=1), ) produces CREATE TABLE test ( "Id" INTEGER NOT NULL, "Name" VARCHAR(60), "Status" INTEGER NOT NULL, PRIMARY KEY ("Id") ); instead of CREATE TABLE test ( "Id" INTEGER NOT NULL, "Name" VARCHAR(60), "Status" INTEGER NOT NULL DEFAULT 1, PRIMARY KEY ("Id") );
Even though the underlying behaviour works, this can lead to big problems if other applications not based on SQLalchemy (shell scripts, C progs) use the same database
Note that I am using sqlite access in this particular case and I did not try MySQL or Pg
Comments (2)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.3.5 (automated comment)
- Log in to comment
"default=1" indicates a client side default which will be assigned on the Python side before an INSERT. server side defaults are specified using "PassiveDefault":
i did make a modification in the docs in changeset:2413 to clarify the "text" clause (which i think should probably not be necessary but for now it eliminates reading the value as a string literal).