Skip to content

Instantly share code, notes, and snippets.

@tgroshon
Last active April 7, 2017 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgroshon/b40eaf01dbec78e132d594c63516a75d to your computer and use it in GitHub Desktop.
Save tgroshon/b40eaf01dbec78e132d594c63516a75d to your computer and use it in GitHub Desktop.
Why does this lock my table for reading? How do I make it NOT lock the table?
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-29 16:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.AddField(
model_name='mymodel',
name='newfield',
field=models.TextField(blank=True, null=True),
),
]
# -- Translates into this SQL --
# BEGIN;
# ALTER TABLE "app.mymodel" ADD COLUMN "newfield" text NULL;
# ALTER TABLE "app.mymodel" ALTER COLUMN "newfield" DROP DEFAULT;
# COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment