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

@@ -1,46 +0,0 @@
"""init
Revision ID: 85284752d1d5
Revises: bbacde35234d
Create Date: 2022-04-30 14:21:08.576738
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '85284752d1d5'
down_revision = 'bbacde35234d'
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('title', sa.Unicode(length=25), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_tags')),
sa.UniqueConstraint('title', name=op.f('uq_tags_title'))
)
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('title', sa.Unicode(length=25), nullable=False),
sa.PrimaryKeyConstraint('topic', name=op.f('pk_topics')),
sa.UniqueConstraint('title', name=op.f('uq_topics_title'))
)
op.create_index(op.f('ix_entries_tag'), 'entries', ['tag'], unique=False)
op.create_index(op.f('ix_entries_topic'), 'entries', ['topic'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_entries_topic'), table_name='entries')
op.drop_index(op.f('ix_entries_tag'), table_name='entries')
op.drop_table('topics')
op.drop_index('topic_index', table_name='tags')
op.drop_table('tags')
# ### end Alembic commands ###

View File

@@ -1,8 +1,8 @@
"""init
Revision ID: 5899f27f265f
Revision ID: 07fa8fad6cc3
Revises:
Create Date: 2018-12-23 16:39:13.677058
Create Date: 2022-05-01 10:48:25.244455
"""
from alembic import op
@@ -10,21 +10,25 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5899f27f265f'
revision = '07fa8fad6cc3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('entries',
op.create_table('tags',
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('created', sa.DateTime(), nullable=True),
sa.Column('edited', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_entries')),
sa.UniqueConstraint('title', name=op.f('uq_entries_title'))
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),
@@ -34,10 +38,25 @@ def upgrade():
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('users')
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 ###

View File

@@ -1,8 +1,8 @@
"""init
Revision ID: e7889eab89c0
Revises: 5899f27f265f
Create Date: 2022-04-19 16:21:57.531003
Revision ID: 1a99bede8b76
Revises: 1c62fb741d2f
Create Date: 2022-05-01 16:50:53.674187
"""
from alembic import op
@@ -10,19 +10,17 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e7889eab89c0'
down_revision = '5899f27f265f'
revision = '1a99bede8b76'
down_revision = '1c62fb741d2f'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('entries', sa.Column('tag', sa.Unicode(), nullable=True))
op.add_column('entries', sa.Column('topic', sa.Unicode(), nullable=True))
op.add_column('entries', sa.Column('title_url', sa.Unicode(length=255), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('entries', 'topic')
op.drop_column('entries', 'tag')
op.drop_column('entries', 'title_url')
# ### end Alembic commands ###

View File

@@ -1,8 +1,8 @@
"""init
Revision ID: bbacde35234d
Revises: e7889eab89c0
Create Date: 2022-04-19 17:09:50.728285
Revision ID: 1c62fb741d2f
Revises: 07fa8fad6cc3
Create Date: 2022-05-01 11:16:29.476581
"""
from alembic import op
@@ -10,17 +10,17 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bbacde35234d'
down_revision = 'e7889eab89c0'
revision = '1c62fb741d2f'
down_revision = '07fa8fad6cc3'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('entries', sa.Column('body_html', sa.UnicodeText(), nullable=True))
op.add_column('entries', sa.Column('tag', sa.Unicode(length=25), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('entries', 'body_html')
op.drop_column('entries', 'tag')
# ### end Alembic commands ###

View File

@@ -1,32 +0,0 @@
"""init
Revision ID: de7d23a4b139
Revises: 85284752d1d5
Create Date: 2022-05-01 08:41:03.244262
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'de7d23a4b139'
down_revision = '85284752d1d5'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('tags', sa.Column('tag_name', sa.Unicode(length=25), nullable=False))
op.create_unique_constraint(op.f('uq_tags_tag_name'), 'tags', ['tag_name'])
op.add_column('topics', sa.Column('topic_name', sa.Unicode(length=25), nullable=False))
op.create_unique_constraint(op.f('uq_topics_topic_name'), 'topics', ['topic_name'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(op.f('uq_topics_topic_name'), 'topics', type_='unique')
op.drop_column('topics', 'topic_name')
op.drop_constraint(op.f('uq_tags_tag_name'), 'tags', type_='unique')
op.drop_column('tags', 'tag_name')
# ### end Alembic commands ###