
from django.db import models


class SecondaryStructure(models.Model):
    id = models.AutoField(primary_key=True)
    accession = models.ForeignKey(
        'Accession',
        db_column='rnc_accession_id',
        to_field='accession',
        related_name='secondary_structure',
    )
    secondary_structure = models.TextField()
    md5 = models.CharField(max_length=32, db_index=True)

    class Meta:
        db_table = 'rnc_secondary_structure'
        unique_together = (('accession', 'md5'),)


from django.db import models


class SecondaryStructure(models.Model):
    id = models.AutoField(primary_key=True)
    accession = models.OneToOneField(
        'Accession',
        db_column='rnc_accession_id',
        to_field='accession',
        related_name='secondary_structure',
    )
    secondary_structure = models.TextField()
    md5 = models.CharField(max_length=32, db_index=True)

    class Meta:
        db_table = 'rnc_secondary_structure'
        unique_together = (('accession', 'md5'),)

Use OneToOneField on SecondaryStructure model
Use OneToOneField on SecondaryStructure model

  
  from django.db import models
  
  
  class SecondaryStructure(models.Model):
      id = models.AutoField(primary_key=True)
-     accession = models.ForeignKey(
+     accession = models.OneToOneField(
          'Accession',
          db_column='rnc_accession_id',
          to_field='accession',
          related_name='secondary_structure',
      )
      secondary_structure = models.TextField()
      md5 = models.CharField(max_length=32, db_index=True)
  
      class Meta:
          db_table = 'rnc_secondary_structure'
          unique_together = (('accession', 'md5'),)
  
Use OneToOneField on SecondaryStructure model
## Code Before:

from django.db import models


class SecondaryStructure(models.Model):
    id = models.AutoField(primary_key=True)
    accession = models.ForeignKey(
        'Accession',
        db_column='rnc_accession_id',
        to_field='accession',
        related_name='secondary_structure',
    )
    secondary_structure = models.TextField()
    md5 = models.CharField(max_length=32, db_index=True)

    class Meta:
        db_table = 'rnc_secondary_structure'
        unique_together = (('accession', 'md5'),)

## Instruction:
Use OneToOneField on SecondaryStructure model
## Code After:

from django.db import models


class SecondaryStructure(models.Model):
    id = models.AutoField(primary_key=True)
    accession = models.OneToOneField(
        'Accession',
        db_column='rnc_accession_id',
        to_field='accession',
        related_name='secondary_structure',
    )
    secondary_structure = models.TextField()
    md5 = models.CharField(max_length=32, db_index=True)

    class Meta:
        db_table = 'rnc_secondary_structure'
        unique_together = (('accession', 'md5'),)
