You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
"""initial migration |
|
|
|
Revision ID: 3c65fc2aac0a |
|
Revises: |
|
Create Date: 2020-12-15 23:06:09.507454 |
|
|
|
""" |
|
from alembic import op |
|
import sqlalchemy as sa |
|
|
|
|
|
# revision identifiers, used by Alembic. |
|
revision = '3c65fc2aac0a' |
|
down_revision = None |
|
branch_labels = None |
|
depends_on = None |
|
|
|
|
|
def upgrade(): |
|
# ### commands auto generated by Alembic - please adjust! ### |
|
op.create_table('url', |
|
sa.Column('id', sa.Integer(), nullable=False), |
|
sa.Column('url', sa.String(length=2000), nullable=False), |
|
sa.Column('hash', sa.String(length=20), nullable=False), |
|
sa.Column('birth', sa.DateTime(), nullable=True), |
|
sa.Column('death', sa.DateTime(), nullable=True), |
|
sa.Column('view_counter', sa.Integer(), nullable=True), |
|
sa.PrimaryKeyConstraint('id') |
|
) |
|
op.create_index(op.f('ix_url_hash'), 'url', ['hash'], unique=True) |
|
# ### end Alembic commands ### |
|
|
|
|
|
def downgrade(): |
|
# ### commands auto generated by Alembic - please adjust! ### |
|
op.drop_index(op.f('ix_url_hash'), table_name='url') |
|
op.drop_table('url') |
|
# ### end Alembic commands ###
|
|
|