Hi I am generating sql for sqlite3

class Language(meta.Model):

        id = meta.CharField(maxlength=2, primary_key=True)
        translation_key = meta.IntegerField()
        status = meta.CharField(choices=LANGUAGE_STATUS_CHOICES, maxlength=8)
        created = meta.DateTimeField(auto_now_add=True)
        modified = meta.DateTimeField(auto_now=True)

        class META:
                db_table = "languages"

It generates the following:

CREATE TABLE languages (
    id varchar(2) NOT NULL PRIMARY KEY,
    translation_key integer NOT NULL,
    status varchar(8) NOT NULL,
    created time NOT NULL,
    modified datetime NOT NULL

Why am I not getting a TIMESTAMP type instead of datetime.  Preferably
I would like a timestamp with timezone.

Also choices are not generating a check statement like:
status VARCHAR(8) CHECK (status in ('active', 'inactive')),

How do I get this back into my SQL.

Many thanks
David

Reply via email to