I had to put checkfirst=True in the calling parameters of create_all

After I set echo=True on the engine I found out that SA was creating tables in 
a different order as I expected.
it started with one of the polymorphic child tables….. that does not work when 
the Integrity is checked upon creation.
I thought about specifying tables to see if that forces the creation order.

Anyway it works now

Martijn

On Jan 18, 2012, at 21:14 , Martijn Moeling wrote:

> I managed to get PG (9.0) installed and I am in the process over moving over 
> from MySQL,
> I allready have stuff working and am now trying to get the main reason for 
> the Quick move: Sequence.
> 
> I have a object like:
> 
> seq=Sequence('serialnumber', metadata=Base.metadata)
> Class Object1(Base):
>       Id                              = Column(Integer, primary_key=True)
>       SerialNumber    = Column(Integer, seq) # Or whatever I try here
> 
> 
> Class Object(Base):
>       Id                              = Column(Integer, primary_key=True)
>       SerialNumber    = Column(Integer, ForeignKey('object1.SerialNumber')
> 
> 
> with a create_all I get this:
> (ProgrammingError) there is no unique constraint matching given keys for 
> referenced table "object1"
> 
> I might be looking in the wrong direction here, the documentation only talks 
> about Sequence with primary_key set to True
> 
> Martijn
> 
> -- 
> 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.

-- 
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.

Reply via email to