web2py / pydal

A pure Python Database Abstraction Layer
BSD 3-Clause "New" or "Revised" License
493 stars 137 forks source link

Fix: Syntax error with SQLite3 and PyDAL #314 #691

Closed XpycTee closed 2 years ago

XpycTee commented 2 years ago

Fixed the syntax error that SQLite throws when the foreign key declaration was inserted immediately after the column declaration. Issue: #314

I moved the declaration of foreign keys to the end of the command.

I'm not sure it won't break anything, but now I have no problems with this in my project.

mdipierro commented 2 years ago

Did you try both python2 and python3?

XpycTee commented 2 years ago

Did you try both python2 and python3?

No, I tried it only on Python3, it seems to me that it should work in python 2, because the change is the same for both versions. I added one string variable reffs, replaced the ftype variable with reffs in the place where foreign keys are written and added reffs to the end where fields are formed