On 9/12/06, Gary Doades <[EMAIL PROTECTED]> wrote:
> As an example, I have a table (product) that is referenced by 11 other tables
> (booking, history, rates, invoice, payroll, timesheets etc.). Those tables
> contain upwards of 10 million rows in the existing application. I certainly
> don't want those records to be deleted just because (by whatever means)
> someone tried to delete a product!!

There are some checks in place for this; the admin app, for example,
will display a confirmation page before allowing a delete, and that
page lists every related object that will be deleted.

Much of the problem with this is that certain databases
*cough*sqlite*cough*mysql*cough* have issues with specifying delete
behavior at the SQL level. I've written this up at some length on the
Django developers list[1], but here's the executive summary:

* Postgres is the only DB which supports the full range of "ON DELETE"
and "ON UPDATE" options consistently.
* MySQL supports them *only* when every table involved is InnoDB.
* SQLite uses "ON CONFLICT", and whether it actually behaves properly
is highly debatable; per its own documentation, it does not enforce
foreign key constraints.

If you read through the referenced thread, there's discussion of some
options but it's a tough problem that we don't yet have a good
solution for.

[1] 
http://groups.google.com/group/django-developers/browse_thread/thread/bae9fcc645c4b04c/#hdropened4c65ac76d85c5c34

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to