I am porting a building scheme system to mysql ( it works on postgresql and 
sqlite so far ) but i have some issues with datetime  ( solved )  and with 
( within others tables ) this table :
 

t_listino_articolo = Table('listino_articolo', params["metadata"],
        Column('id_listino', 
Integer,ForeignKey(fk_prefix+"listino.id",onupdate="CASCADE",ondelete="CASCADE"),primary_key=True),
        Column('id_articolo', Integer, 
ForeignKey(fk_prefix+"articolo.id",onupdate="CASCADE",ondelete="CASCADE"),primary_key=True),
        Column('prezzo_dettaglio', Numeric(16,4)),
        Column('prezzo_ingrosso', Numeric(16,4)),
        Column('ultimo_costo', Numeric(16,4), nullable=True),
        Column('data_listino_articolo', 
DateTime,ColumnDefault(datetime.datetime.now),nullable=False,primary_key=True),
        Column('listino_attuale', Boolean, nullable=False),
        #ForeignKeyConstraint(['id_listino', 
'id_articolo'],[fk_prefix+'.listino.id', 
fk_prefix+'.articolo.id'],onupdate="CASCADE", ondelete="CASCADE"),
        CheckConstraint("prezzo_dettaglio is not NULL OR prezzo_ingrosso is 
not NULL"),
        schema=params["schema"]
        )
t_listino_articolo.create(checkfirst=True)


that what echo says, not much: 

2013-07-23 12:59:58,592 INFO sqlalchemy.engine.base.Engine DESCRIBE 
`listino_articolo`
2013-07-23 12:59:58,592 INFO sqlalchemy.engine.base.Engine ()
2013-07-23 12:59:58,593 INFO sqlalchemy.engine.base.Engine ROLLBACK
2013-07-23 12:59:58,596 INFO sqlalchemy.engine.base.Engine 
CREATE TABLE listino_articolo (
    id_listino INTEGER NOT NULL, 
    id_articolo INTEGER NOT NULL, 
    prezzo_dettaglio NUMERIC(16, 4), 
    prezzo_ingrosso NUMERIC(16, 4), 
    ultimo_costo NUMERIC(16, 4), 
    data_listino_articolo DATETIME NOT NULL, 
    listino_attuale BOOL NOT NULL, 
    PRIMARY KEY (id_listino, id_articolo, data_listino_articolo), 
    CHECK (prezzo_dettaglio is not NULL OR prezzo_ingrosso is not NULL), 
    FOREIGN KEY(id_listino) REFERENCES listino (id) ON DELETE CASCADE ON 
UPDATE CASCADE, 
    FOREIGN KEY(id_articolo) REFERENCES articolo (id) ON DELETE CASCADE ON 
UPDATE CASCADE, 
    CHECK (listino_attuale IN (0, 1))
)


2013-07-23 12:59:58,596 INFO sqlalchemy.engine.base.Engine ()
2013-07-23 12:59:58,607 INFO sqlalchemy.engine.base.Engine ROLLBACK

thanks 
F.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to