added urlified title in title_url

This commit is contained in:
2022-05-01 16:55:15 +02:00
parent 0a307fc953
commit 7c7a0c3a54
16 changed files with 884 additions and 144 deletions

View File

@@ -0,0 +1,62 @@
"""init
Revision ID: 07fa8fad6cc3
Revises:
Create Date: 2022-05-01 10:48:25.244455
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '07fa8fad6cc3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('tags',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('topic', sa.Unicode(length=25), nullable=True),
sa.Column('tag', sa.Unicode(length=25), nullable=True),
sa.Column('tag_name', sa.Unicode(length=25), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_tags'))
)
op.create_index('topic_index', 'tags', ['topic', 'tag'], unique=False)
op.create_table('topics',
sa.Column('topic', sa.Unicode(length=25), nullable=False),
sa.Column('topic_name', sa.Unicode(length=25), nullable=False),
sa.PrimaryKeyConstraint('topic', name=op.f('pk_topics'))
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.Unicode(length=255), nullable=False),
sa.Column('password', sa.Unicode(length=255), nullable=False),
sa.Column('last_logged', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_users')),
sa.UniqueConstraint('name', name=op.f('uq_users_name'))
)
op.create_table('entries',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.Unicode(length=255), nullable=False),
sa.Column('body', sa.UnicodeText(), nullable=True),
sa.Column('body_html', sa.UnicodeText(), nullable=True),
sa.Column('created', sa.DateTime(), nullable=True),
sa.Column('edited', sa.DateTime(), nullable=True),
sa.Column('topic_id', sa.Unicode(length=25), nullable=False),
sa.ForeignKeyConstraint(['topic_id'], ['topics.topic'], name=op.f('fk_entries_topic_id_topics')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_entries')),
sa.UniqueConstraint('title', name=op.f('uq_entries_title'))
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('entries')
op.drop_table('users')
op.drop_table('topics')
op.drop_index('topic_index', table_name='tags')
op.drop_table('tags')
# ### end Alembic commands ###