new entries schema

This commit is contained in:
2023-01-21 09:53:42 +01:00
parent 6a8153cecb
commit 59e2a50a3f
13 changed files with 54 additions and 189 deletions

View File

@@ -1,26 +0,0 @@
"""init
Revision ID: bbacde35234d
Revises: e7889eab89c0
Create Date: 2022-04-19 17:09:50.728285
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bbacde35234d'
down_revision = 'e7889eab89c0'
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))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('entries', 'body_html')
# ### end Alembic commands ###

View File

@@ -1,28 +0,0 @@
"""init
Revision ID: e7889eab89c0
Revises: 5899f27f265f
Create Date: 2022-04-19 16:21:57.531003
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e7889eab89c0'
down_revision = '5899f27f265f'
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))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('entries', 'topic')
op.drop_column('entries', 'tag')
# ### end Alembic commands ###

View File

@@ -1,28 +0,0 @@
"""init
Revision ID: 7cfe6f79c819
Revises: b6095fa68edc
Create Date: 2022-12-08 16:30:41.529957
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7cfe6f79c819'
down_revision = 'b6095fa68edc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('groups', sa.Unicode(), nullable=True))
op.drop_column('users', 'group')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('group', sa.VARCHAR(), nullable=True))
op.drop_column('users', 'groups')
# ### end Alembic commands ###

View File

@@ -1,26 +0,0 @@
"""init
Revision ID: 86d2844ace15
Revises: bbacde35234d
Create Date: 2022-12-08 15:53:57.291157
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '86d2844ace15'
down_revision = 'bbacde35234d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('group', sa.Unicode(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('users', 'group')
# ### end Alembic commands ###

View File

@@ -1,26 +0,0 @@
"""init
Revision ID: b6095fa68edc
Revises: 86d2844ace15
Create Date: 2022-12-08 16:22:49.206993
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b6095fa68edc'
down_revision = '86d2844ace15'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -1,8 +1,8 @@
"""init
Revision ID: 5899f27f265f
Revision ID: d335bb2cb9da
Revises:
Create Date: 2018-12-23 16:39:13.677058
Create Date: 2023-01-21 08:05:36.719719
"""
from alembic import op
@@ -10,21 +10,18 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5899f27f265f'
revision = 'd335bb2cb9da'
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('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_table('users',
sa.Column('id', sa.Integer(), nullable=False),
@@ -34,10 +31,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('created', sa.DateTime(), nullable=True),
sa.Column('creator', sa.Unicode(length=50), nullable=True),
sa.Column('edited', sa.DateTime(), nullable=True),
sa.Column('editor', sa.Unicode(length=50), nullable=True),
sa.Column('tag', sa.Unicode(length=25), nullable=True),
sa.Column('author', sa.Unicode(length=50), nullable=True),
sa.Column('status', sa.Unicode(length=50), nullable=True),
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('tags')
# ### end Alembic commands ###