From 37ee637f7ec6854833aa1ecc4e715811b5a9d005 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 20 May 2020 11:09:06 +1000 Subject: [PATCH] Add the task table --- .gitignore | 3 ++ .../versions/40867bd0dcc8_add_tasks_table.py | 29 +++++++++++++++++++ db/.keep | 0 3 files changed, 32 insertions(+) create mode 100644 alembic/versions/40867bd0dcc8_add_tasks_table.py create mode 100644 db/.keep diff --git a/.gitignore b/.gitignore index f7275bb..8bbb0cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ venv/ +__pycache__/ + +db/data.sqlite diff --git a/alembic/versions/40867bd0dcc8_add_tasks_table.py b/alembic/versions/40867bd0dcc8_add_tasks_table.py new file mode 100644 index 0000000..363f90a --- /dev/null +++ b/alembic/versions/40867bd0dcc8_add_tasks_table.py @@ -0,0 +1,29 @@ +"""add tasks table + +Revision ID: 40867bd0dcc8 +Revises: +Create Date: 2020-05-20 10:59:38.018843 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '40867bd0dcc8' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade(): + op.create_table( + 'tasks', + sa.Column('id', sa.Integer, primary_key=True), + sa.Column('title', sa.String, nullable=False) + ) + pass + + +def downgrade(): + op.drop_table('tasks') diff --git a/db/.keep b/db/.keep new file mode 100644 index 0000000..e69de29