Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ross I Kinsey
where
Commits
3057ba5a
Unverified
Commit
3057ba5a
authored
Feb 16, 2020
by
Dylan Jones
Browse files
coldness
parent
ae28fea1
Changes
3
Hide whitespace changes
Inline
Side-by-side
where/alembic/versions/f0d89367cd54_add_coldness.py
0 → 100644
View file @
3057ba5a
"""add coldness
Revision ID: f0d89367cd54
Revises: 24dfd0eb9da6
Create Date: 2020-02-16 19:24:40.144498
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'f0d89367cd54'
down_revision
=
'24dfd0eb9da6'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
add_column
(
'category'
,
sa
.
Column
(
'icon'
,
sa
.
String
(),
nullable
=
True
))
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_column
(
'category'
,
'icon'
)
# ### end Alembic commands ###
where/app.py
View file @
3057ba5a
...
...
@@ -26,9 +26,12 @@ def test_data():
session
.
query
(
sa
.
Point
).
delete
()
session
.
query
(
sa
.
Field
).
delete
()
session
.
query
(
sa
.
Category
).
delete
()
# Water Fountain, the class.
wf
=
sa
.
Category
()
wf
.
name
=
"Water Fountain"
wf
.
slug
=
"water_fountain"
wf
.
icon
# coldness
if
__name__
==
'__main__'
:
...
...
where/sa.py
View file @
3057ba5a
...
...
@@ -66,6 +66,7 @@ class Category(Base):
__tablename__
=
'category'
name
=
Column
(
String
,
nullable
=
False
,
unique
=
True
)
icon
=
Column
(
String
,
nullable
=
True
)
fields
=
relationship
(
"Field"
)
...
...
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