diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-07-10 20:20:18 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-07-10 20:20:18 +0200 |
| commit | 3545b13fec6f041bb72ab7f355d16fc6eeec7032 (patch) | |
| tree | 55bb492db42aca52a4f758eb360f36de6574f227 /cli | |
| parent | 67659a964be681a920d4fbc4d839ba95b0947edb (diff) | |
add homepage id to graph
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/app/sql/models/graph.py | 2 | ||||
| -rw-r--r-- | cli/app/sql/versions/202007102019_add_home_page_id_to_graph.py | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/cli/app/sql/models/graph.py b/cli/app/sql/models/graph.py index fdea32a..fbfb09c 100644 --- a/cli/app/sql/models/graph.py +++ b/cli/app/sql/models/graph.py @@ -13,6 +13,7 @@ class Graph(Base): """Table for storing references to graphs""" __tablename__ = 'graph' id = Column(Integer, primary_key=True) + home_page_id = Column(Integer, nullable=True) path = Column(String(64, convert_unicode=True), nullable=False) title = Column(String(64, convert_unicode=True), nullable=False) username = Column(String(32, convert_unicode=True), nullable=False) @@ -26,6 +27,7 @@ class Graph(Base): def toJSON(self): return { 'id': self.id, + 'home_page_id': self.home_page_id, 'path': self.path, 'title': self.title, 'username': self.username, diff --git a/cli/app/sql/versions/202007102019_add_home_page_id_to_graph.py b/cli/app/sql/versions/202007102019_add_home_page_id_to_graph.py new file mode 100644 index 0000000..9f44d3a --- /dev/null +++ b/cli/app/sql/versions/202007102019_add_home_page_id_to_graph.py @@ -0,0 +1,29 @@ +"""add home_page_id to graph + +Revision ID: d929da3e398b +Revises: 91a729020584 +Create Date: 2020-07-10 20:19:55.467411 + +""" +from alembic import op +import sqlalchemy as sa +import sqlalchemy_utc + + +# revision identifiers, used by Alembic. +revision = 'd929da3e398b' +down_revision = '91a729020584' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('graph', sa.Column('home_page_id', sa.Integer(), nullable=True)) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('graph', 'home_page_id') + # ### end Alembic commands ### |
