1. 2
  1.  

  2. 2

    I was wondering why Django does not generate an SQL migration statement with the CONCURRENTLY keyword directly.

    I have found a recent discussion about it on the GitHub project: https://github.com/django/django/pull/10901

    1. 1

      I’ve seen this PR. It essentally does the same thing described in the article, but using a custom migration command.

      I feel the problem with this approach is that

      1. It forces you to edit the migration, replace the command and set the migration to be atomic. I think a safer solution (if any) that is offered by the migration fw, should be implemented as an attribute on the existing command.
      2. This is very PostgreSQL specific. As mentioned in the article, other database vendors, such as Oracle, also support this but using a different syntax.