Opened 14 years ago
Closed 14 years ago
#15643 closed (duplicate)
Custom SQL can not be executed in any way
Reported by: | Vlastimil Zíma | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
According to documentation it should be possible to use custom SQL for databases. But there is no way how we can "create SQL functions, views, triggers, etc." as documentation says.
When you try to use initial SQL it parses and messes what is in file unless it is some basic statement like INSERT. You can not really add trigger, because django messes your SQL by running what is between semicolons separately.
When you try to use post_syncdb signal to run your custom SQL then you can not use flush command, because it fails on database errors that your triggers/functions/constraints/... already exists and it is not possible to write IF NOT EXISTS everywhere.
Best solution for all is to remove the parser for custom SQL, it can not prevent errors anyway, we can still insert wrong values. Just let us upload our SQLs without messing them up and let us handle our SQL ourselves.
Change History (2)
comment:1 by , 14 years ago
Component: | Uncategorized → django-admin.py |
---|
comment:2 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #3485