diff options
| author | rubenwardy <rw@rubenwardy.com> | 2019-11-22 14:33:22 +0000 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2019-11-27 01:06:58 +0000 |
| commit | 4ce388c8aa5d5502408609983535a9812d41d6d1 (patch) | |
| tree | 5ad9123949ca2068dfe975284d0f1b3acdf5b437 /migrations | |
| parent | cb5451fe5d49e0eda379e3cd636c54e8ea1a3f8e (diff) | |
| download | cheatdb-4ce388c8aa5d5502408609983535a9812d41d6d1.tar.xz | |
Add API Token creation
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/versions/fd25bf3e57c3_.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/migrations/versions/fd25bf3e57c3_.py b/migrations/versions/fd25bf3e57c3_.py new file mode 100644 index 0000000..ec6e56f --- /dev/null +++ b/migrations/versions/fd25bf3e57c3_.py @@ -0,0 +1,37 @@ +"""empty message + +Revision ID: fd25bf3e57c3 +Revises: d6ae9682c45f +Create Date: 2019-11-26 23:43:47.476346 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'fd25bf3e57c3' +down_revision = 'd6ae9682c45f' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('api_token', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('access_token', sa.String(length=34), nullable=True), + sa.Column('name', sa.String(length=100), nullable=False), + sa.Column('owner_id', sa.Integer(), nullable=False), + sa.Column('created_at', sa.DateTime(), nullable=False), + sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id'), + sa.UniqueConstraint('access_token') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('api_token') + # ### end Alembic commands ### |
