I am creating a table in my PostGres db but the time stamp show as :
2015-01-25T22:22:46+08:00
I would like to have it show as seconds instead of date .
This is what I have done :
def upgrade():
op.execute('''
CREATE TABLE api_responses (
id TEXT PRIMARY KEY,
ts timestamp without time zone not null default (now() at time zone 'utc'),
userid TEXT,
response JSONB NOT NULL DEFAULT '{}',
intent TEXT
);
''')
op.execute('CREATE INDEX ON api_responses (id);')
op.execute('CREATE INDEX ON api_responses (ts DESC);')
def downgrade():
op.execute('DROP TABLE api_responses')
I didn't find any options to transform now() and get it in seconds
I do not want to do it during the select/extract but automatically through the alembic versioning mecanism