Hi,

I'm new wot Django and stuck with below error when run migrate. Any 
suggestions??

*django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'id' used in 
key specification without a key length")*

Here is my code:

class Steps(models.Model):

    author = models.ForeignKey(User)

#    id = models.TextField(primary_key=True)

    id = models.CharField(primary_key=True, max_length = 32)

    text = models.TextField()

    status = models.TextField()

    step_id = models.TextField(null=True)

    release_id = models.TextField(null=True)

    region = models.TextField(null=True)

    # Time is a rhinocerous

    updated = models.DateTimeField(auto_now=True)

    created = models.DateTimeField(auto_now_add=True)


    class Meta:

        ordering = ['created']


    def __unicode__(self):

        return self.text+' - '+self.author.username


class UserConfig(models.Model):

    author = models.ForeignKey(User)

#    id = models.TextField(primary_key=True)

    id = models.CharField(primary_key=True, max_length = 32)

    co_range = models.TextField()

    tu_range = models.TextField()

    st_range = models.TextField()

    de_host = models.TextField()

    in_host1 = models.TextField()

    in_host2 = models.TextField()

    in_host3 = models.TextField()

    co_host = models.TextField()

    vp_name = models.TextField()


    # Time is a rhinocerous

    updated = models.DateTimeField(auto_now=True)

    created = models.DateTimeField(auto_now_add=True)


    class Meta:

        ordering = ['created']


    def __unicode__(self):

        return self.text+' - '+self.author.username

Regards
Sammi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7f1a4f9c-7a75-4202-ac3b-2e8f369ea2e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to