Hi
My app is using SQLAlchemy0.5.6.
I have a class defined as follows.
class EmailSetup(DeclarativeBase):
__tablename__ = 'emailsetup'
id = Column(Unicode(50), primary_key=True)
mail_server=Column(Unicode(255))
description=Column(String(200))
port = Column(Integer)
use_secure = Column(Integer) #No, TLS, SSL
site_id = Column(Unicode(50),
ForeignKey('sites.id',onupdate="CASCADE", ondelete="CASCADE"))
credential=relation(Credential, \
primaryjoin=id == Credential.entity_id,\
foreign_keys=[Credential.entity_id],\
uselist=False,cascade='all, delete, delete-
orphan')
this works fine on ubuntu installation . (MySQL 5.1.37)
it creates foreign constraint to the sites table.
CREATE TABLE `emailsetup` (
`id` varchar(50) NOT NULL,
`mail_server` varchar(255) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`port` int(11) DEFAULT NULL,
`use_secure` int(11) DEFAULT NULL,
`site_id` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `site_id` (`site_id`),
CONSTRAINT `emailsetup_ibfk_1` FOREIGN KEY (`site_id`) REFERENCES
`sites` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8
But in centos (MySQL 5.0.77) , the foreign key constraint is missing
when i check with a show create table.
CREATE TABLE `emailsetup` (
`id` varchar(50) NOT NULL,
`mail_server` varchar(255) default NULL,
`description` varchar(200) default NULL,
`port` int(11) default NULL,
`use_secure` int(11) default NULL,
`site_id` varchar(50) default NULL,
PRIMARY KEY (`id`),
KEY `site_id` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
any idea what is happening
Is this an issue related to SA or MySQL?
Thanks
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.