diff options
author | Unto Markkanen <umarkkan@local> | 2023-12-03 12:28:53 +0200 |
---|---|---|
committer | Unto Markkanen <umarkkan@local> | 2023-12-03 12:28:53 +0200 |
commit | 7353c51df2d074cbe01913044bda7aeef62a31b7 (patch) | |
tree | b6cae4d33ac4039819acbfca33391c94f48580cd /db/user.py | |
parent | e15e4b93c203ba94f413e97955c48d8761a70423 (diff) |
Modifying SQL SCHEMA to generate timestamps by itself.
Diffstat (limited to 'db/user.py')
-rw-r--r-- | db/user.py | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1,5 +1,3 @@ -from time import time - from sqlalchemy.sql import text class DBUser: @@ -15,12 +13,10 @@ class DBUser: def new(self, nick): sql = "INSERT \ - INTO users (nick, created) \ - VALUES (:nick, :created) \ + INTO users (nick) \ + VALUES (:nick) \ RETURNING id ;" - result = self.db.session.execute( - text(sql), { "nick":nick, "created":int(time()) } - ) + result = self.db.session.execute( text(sql), { "nick":nick } ) self.db.session.commit() return result.fetchone()[0] |