Code

Opened 3 years ago

Closed 3 years ago

#15643 closed (duplicate)

Custom SQL can not be executed in any way

Reported by: vzima Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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.

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by vzima

  • Component changed from Uncategorized to django-admin.py
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by russellm

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3485

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.