#29170: Unable to add triggers in migrations on Oracle.
-------------------------------------+-------------------------------------
     Reporter:  Danny Willems        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  3.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  oracle trigger       |             Triage Stage:  Accepted
  database                           |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * stage:  Unreviewed => Accepted


Comment:

 Thanks Václav. I was able to reproduce this issue, it's related with
 splitting SQL into multiple statements with `sqlparse.split(sql)` (see
 
[https://github.com/django/django/blob/00ff7a44dee91be59a64559cadeeba0f7386fd6f/django/db/backends/base/operations.py#L296-L308
 prepare_sql_script()]). It splits `CREATE TRIGGER` statement on `END;`
 into:
 - `CREATE TRIGGER ... END;` and
 - `/` (which is an empty string after `fix_for_params()`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29170#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.b10d18e4969d5121fdd1241adb90e848%40djangoproject.com.

Reply via email to