from __future__ import unicode_literals

from django.db import models
import django_pgjsonb


class Feed(models.Model):
    id = models.BigIntegerField(primary_key=True)
    article_id = models.BigIntegerField(unique=True)
    article_json = django_pgjsonb.JSONField()

    class Meta:
        db_table = 'feed'


class Image(models.Model):
    article = models.ForeignKey(Feed, blank=True, null=True)
    url = models.TextField()
    nude_percent = models.IntegerField(blank=True, null=True)
    path = models.ImageField(null=True)

    class Meta:
        db_table = 'image'
        unique_together = (('url', 'article'),)

from __future__ import unicode_literals

from django.db import models
import django_pgjsonb


class Feed(models.Model):
    id = models.AutoField(primary_key=True)
    article_id = models.BigIntegerField(unique=True)
    article_json = django_pgjsonb.JSONField()

    class Meta:
        db_table = 'feed'


class Image(models.Model):
    id = models.AutoField(primary_key=True)
    article = models.ForeignKey(Feed, blank=True, null=True)
    url = models.TextField()
    nude_percent = models.IntegerField(blank=True, null=True)
    path = models.ImageField(null=True)

    class Meta:
        db_table = 'image'
        unique_together = (('url', 'article'),)

Fix model id to auto increment
Fix model id to auto increment

  from __future__ import unicode_literals
  
  from django.db import models
  import django_pgjsonb
  
  
  class Feed(models.Model):
-     id = models.BigIntegerField(primary_key=True)
+     id = models.AutoField(primary_key=True)
      article_id = models.BigIntegerField(unique=True)
      article_json = django_pgjsonb.JSONField()
  
      class Meta:
          db_table = 'feed'
  
  
  class Image(models.Model):
+     id = models.AutoField(primary_key=True)
      article = models.ForeignKey(Feed, blank=True, null=True)
      url = models.TextField()
      nude_percent = models.IntegerField(blank=True, null=True)
      path = models.ImageField(null=True)
  
      class Meta:
          db_table = 'image'
          unique_together = (('url', 'article'),)
  
Fix model id to auto increment
## Code Before:
from __future__ import unicode_literals

from django.db import models
import django_pgjsonb


class Feed(models.Model):
    id = models.BigIntegerField(primary_key=True)
    article_id = models.BigIntegerField(unique=True)
    article_json = django_pgjsonb.JSONField()

    class Meta:
        db_table = 'feed'


class Image(models.Model):
    article = models.ForeignKey(Feed, blank=True, null=True)
    url = models.TextField()
    nude_percent = models.IntegerField(blank=True, null=True)
    path = models.ImageField(null=True)

    class Meta:
        db_table = 'image'
        unique_together = (('url', 'article'),)

## Instruction:
Fix model id to auto increment
## Code After:
from __future__ import unicode_literals

from django.db import models
import django_pgjsonb


class Feed(models.Model):
    id = models.AutoField(primary_key=True)
    article_id = models.BigIntegerField(unique=True)
    article_json = django_pgjsonb.JSONField()

    class Meta:
        db_table = 'feed'


class Image(models.Model):
    id = models.AutoField(primary_key=True)
    article = models.ForeignKey(Feed, blank=True, null=True)
    url = models.TextField()
    nude_percent = models.IntegerField(blank=True, null=True)
    path = models.ImageField(null=True)

    class Meta:
        db_table = 'image'
        unique_together = (('url', 'article'),)
