Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
275c9eb3
Commit
275c9eb3
authored
Jul 06, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DB] Put a timezone on Node.date
parent
672bca04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
08230100f262_put_a_timezone_on_node_date.py
alembic/versions/08230100f262_put_a_timezone_on_node_date.py
+25
-0
nodes.py
gargantext/models/nodes.py
+1
-1
No files found.
alembic/versions/08230100f262_put_a_timezone_on_node_date.py
0 → 100644
View file @
275c9eb3
"""Put a timezone on Node.date
Revision ID: 08230100f262
Revises: 601e9d9baa4c
Create Date: 2017-07-06 13:47:10.788569
"""
from
alembic
import
op
import
sqlalchemy
as
sa
import
gargantext
# revision identifiers, used by Alembic.
revision
=
'08230100f262'
down_revision
=
'601e9d9baa4c'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
op
.
alter_column
(
'nodes'
,
'date'
,
type_
=
sa
.
DateTime
(
timezone
=
True
))
def
downgrade
():
op
.
alter_column
(
'nodes'
,
'date'
,
type_
=
sa
.
DateTime
(
timezone
=
False
))
gargantext/models/nodes.py
View file @
275c9eb3
...
...
@@ -64,7 +64,7 @@ class Node(Base):
parent_id
=
Column
(
Integer
,
ForeignKey
(
'nodes.id'
,
ondelete
=
'CASCADE'
))
# main data
name
=
Column
(
String
(
255
))
date
=
Column
(
DateTime
(),
default
=
datetime
.
now
)
date
=
Column
(
DateTime
(
timezone
=
True
),
default
=
datetime
.
now
)
# metadata (see https://bashelton.com/2014/03/updating-postgresql-json-fields-via-sqlalchemy/)
hyperdata
=
Column
(
JSONB
,
default
=
dict
)
...
...
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