Hi Team,
My application using sqlite DB and in my model table class, I have define attributes like Below -
class MyUser(AbstractBaseUser):
email = models.EmailField(
verbose_name='email address',
max_length=255,
unique=True,
)
date_of_birth = models.DateField()
is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
objects = MyUserManager()
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['date_of_birth']
But we I see the same table in sqlite interface, it shows me table definition like this-
sqlite> .dump authapp_myuser
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE "authapp_myuser" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "password" varchar(128) NOT NULL, "last_login" datetime NULL, "email" varchar(255) NOT NULL UNIQUE, "date_of_birth" date NOT NULL, "is_active" bool NOT NULL, "is_admin" bool NOT NULL);
COMMIT;
If I am giving is_active field with default value True, Then why its not showing in "is_active" bool NOT NULL.
This case is working fine when I insert any data from GUI application or Django admin page, If I try to insert something from sqlite interface, I need to pass that default value too.
Please give some suggestion, Because I have requirment where I need to insert or update the table values from outside Django App.