Skip to content

Instantly share code, notes, and snippets.

@tade0726
Created May 10, 2018 08:44
Show Gist options
  • Save tade0726/c9d25d41d8a9b3209d0e63597906334c to your computer and use it in GitHub Desktop.
Save tade0726/c9d25d41d8a9b3209d0e63597906334c to your computer and use it in GitHub Desktop.

Revisions

  1. tade0726 created this gist May 10, 2018.
    4 changes: 4 additions & 0 deletions django_note.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    ## change pk to united keys, django will add a new id field, original data will become null-value on id column

    - solution: always add id field as pk
    - refs: https://docs.djangoproject.com/en/2.0/topics/db/models/#automatic-primary-key-fields