Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
url-checker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
url-checker
Commits
03b9e296
Commit
03b9e296
authored
Dec 09, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Autoincrement status id.
Use milliseconds timestamp
parent
df2aed92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
urlchecker_db.py
urlchecker_db.py
+8
-3
No files found.
urlchecker_db.py
View file @
03b9e296
import
peewee
import
peewee
from
playhouse.migrate
import
migrate
,
SqliteMigrator
from
playhouse.migrate
import
migrate
,
SqliteMigrator
from
playhouse.sqlite_ext
import
SqliteExtDatabase
from
playhouse.sqlite_ext
import
SqliteExtDatabase
import
datetime
class
LogDB
:
class
LogDB
:
...
@@ -17,11 +18,15 @@ class LogDB:
...
@@ -17,11 +18,15 @@ class LogDB:
# This store the start, stop, loop time of the bot
# This store the start, stop, loop time of the bot
# All other tables point to it to be able to group some info
# All other tables point to it to be able to group some info
class
Status
(
BaseModel
):
class
Status
(
BaseModel
):
# Ensure the id is always incremented
id
=
peewee
.
AutoField
()
text
=
peewee
.
TextField
()
text
=
peewee
.
TextField
()
# date is in UTC
# https://www.sqlite.org/lang_datefunc.html
timestamp
=
peewee
.
TimestampField
(
timestamp
=
peewee
.
TimestampField
(
constraints
=
[
peewee
.
SQL
(
"DEFAULT now"
)]
# Store millisecond resolution
resolution
=
3
,
# date is in UTC
utc
=
True
,
default
=
datetime
.
datetime
.
now
,
)
)
# Store the configuration modification
# Store the configuration modification
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment