'django - Unable to set delimiter in raw sql (MySQL)

I want to define a stored procedure by a migration. Before this I'm trying to set delimiter but getting django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER $$' at line 1")

Code:

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('...', '...'),
    ]

    operations = [
        migrations.RunSQL("DELIMITER $$"),
        # ...
        migrations.RunSQL("DELIMITER ;"),
    ]

I've found information about DELIMITER is a client keyword which might be not supported by specific tool but what is the right way in django?



Solution 1:[1]

Setting delimiter wasn't needed. I just removed these rows and it worked. (see post comments)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Powercoder