I'm new to learning django. I'm using PostgreSQL as my database. I created an app called gplus and a model I created looks something like this
class Account(AbstractBaseUser):
email = models.EmailField(max_length=50, unique=True)
username = models.CharField(max_length=50, unique=True)
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
date_of_birth = models.DateTimeField()
I applied the migrations and then wanted to change the primary key field from default 'id' to 'username'. So, in the psql command line I ran the following commands
ALTER TABLE gplus_account DROP CONSTRAINT gplus_account_pkey;
ALTER TABLE gplus_account ADD PRIMARY KEY (username);
ALTER TABLE gplus_account DROP COLUMN id;
Then in the models.py, I edited the username field as
username = models.CharField(max_length=50, primary_key=true)
Now, when I try to apply the migrations, I get the error
django.db.utils.ProgrammingError: column "id" of relation "gplus_account" does not exist
It seems Django needs to know there is no 'id' field in the table anymore. How can I do that?
Thanks