class Account(AbstractBaseUser, PermissionsMixin):email = models.EmailField(verbose_name=_('email address'),max_length=255,unique=True,db_index=True,)username = models.CharField(_('username'),max_length=75,unique=True,help_text=_('Required. 75 characters or fewer. Letters, numbers and @/./+/-/_ characters'),validators=[validators.RegexValidator(re.compile('^[\w.@+-]+$'), _('Enter a valid username.'),'invalid')])is_staff = models.BooleanField(_('staff status'), default=False,help_text=_('Designates whether the user can log into this admin site.'))is_active = models.BooleanField(default=True)is_admin = models.BooleanField(default=False)date_joined = models.DateTimeField(_('date joined'), default=timezone.now)objects = AccountManager()USERNAME_FIELD = 'email'REQUIRED_FIELDS = ['username']def get_full_name(self):# The user is identified by their email addressreturn self.emaildef get_short_name(self):# The user is identified by their email addressreturn self.emaildef __unicode__(self):return self.email
./manage.py migrate
Running migrations for auth:
- Migrating forwards to 0001_initial.
> auth:0001_initial
FATAL ERROR - The following SQL query failed: CREATE TABLE `auth_permission` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `name` varchar(50) NOT NULL, `content_type_id` integer NOT NULL, `codename` varchar(100) NOT NULL);
The error was: (1050, "Table 'auth_permission' already exists")
! Error found during real run of migration! Aborting.
! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.
! You *might* be able to recover with: - no dry run output for delete_unique_column() due to dynamic DDL, sorry
= DROP TABLE `auth_permission` CASCADE; []
= DROP TABLE `auth_group` CASCADE; []
= DROP TABLE `auth_group_permissions` CASCADE; []
= DROP TABLE `auth_user` CASCADE; []
= DROP TABLE `auth_user_groups` CASCADE; []
= DROP TABLE `auth_user_user_permissions` CASCADE; []
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS (one that supports DDL transactions)
! NOTE: The error which caused the migration to fail is further up.
Error in migration: auth:0001_initial
DatabaseError: (1050, "Table 'auth_permission' already exists")
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/WR_xxyrJGusJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.