Got it, thanks for your help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL
I thought this was a scope problem, but it seems to be even bigger.
This is the error I get:
OperationalError: (OperationalError) (1067, Invalid default value for
'date_created') u'\nCREATE TABLE fu_op_requests (\n
\tfu_op_requests_id INTEGER NOT NULL AUTO_INCREMENT, \n\tname
VARCHAR(50),
running this script:
import sqlalchemy
from sqlalchemy.databases import mysql
engine = sqlalchemy.create_engine('mysql://scott:[EMAIL PROTECTED]/
test', echo=True)
metadata = sqlalchemy.MetaData(engine)
purchases_table = sqlalchemy.Table('fu_op_purchases',metadata,
to my knowledge MySQL doesn't support DEFAULT on date/time columns.
You can work with the MySQL database directly a little bit to confirm
this.
On Jun 28, 2008, at 3:18 PM, Gloria W wrote:
Hi All,
Looking back in these posts, I tried several older variants of MySQL
datetime column
Gloria W wrote:
Hi All,
Looking back in these posts, I tried several older variants of MySQL
datetime column initialization discussed here, and they're not
working.
This works in Postgresql:
sqlalchemy.Column('date_created', sqlalchemy.DateTime,
jason kirtland wrote:
Gloria W wrote:
Hi All,
Looking back in these posts, I tried several older variants of MySQL
datetime column initialization discussed here, and they're not
working.
This works in Postgresql:
sqlalchemy.Column('date_created', sqlalchemy.DateTime,
This gives me an error:
sqlalchemy.Column('date_created', mysql.MSTimeStamp,
sqlalchemy.PassiveDefault(text(CURRENT_TIMESTAMP)),
nullable=False))
NameError: global name 'text' is not defined
--~--~-~--~~~---~--~~
You received this message because you are
Gloria W wrote:
This gives me an error:
sqlalchemy.Column('date_created', mysql.MSTimeStamp,
sqlalchemy.PassiveDefault(text(CURRENT_TIMESTAMP)),
nullable=False))
NameError: global name 'text' is not defined
from sqlalchemy import text