Skip to content

Commit

Permalink
Added preview column to the media table
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimaHoarder committed Feb 4, 2021
1 parent c9f9921 commit ed448d9
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""content
Revision ID: d0118d8ec0b4
Revises: 2c36fcc0b921
Create Date: 2021-02-04 02:59:06.516503
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd0118d8ec0b4'
down_revision = '2c36fcc0b921'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('medias', schema=None) as batch_op:
batch_op.add_column(sa.Column('preview', sa.Integer(), nullable=True))

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('medias', schema=None) as batch_op:
batch_op.drop_column('preview')

# ### end Alembic commands ###
Binary file modified database/databases/messages/test_messages.db
Binary file not shown.
32 changes: 32 additions & 0 deletions database/databases/posts/alembic/versions/5b4bea08c27f_content.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""content
Revision ID: 5b4bea08c27f
Revises: 194e05269f09
Create Date: 2021-02-04 02:59:05.010106
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5b4bea08c27f'
down_revision = '194e05269f09'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('medias', schema=None) as batch_op:
batch_op.add_column(sa.Column('preview', sa.Integer(), nullable=True))

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('medias', schema=None) as batch_op:
batch_op.drop_column('preview')

# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""content
Revision ID: 29f675c35eee
Revises: 3076beb33c1b
Create Date: 2021-02-04 02:59:01.746229
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '29f675c35eee'
down_revision = '3076beb33c1b'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('medias', schema=None) as batch_op:
batch_op.add_column(sa.Column('preview', sa.Integer(), nullable=True))

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('medias', schema=None) as batch_op:
batch_op.drop_column('preview')

# ### end Alembic commands ###
Binary file modified database/databases/stories/test_stories.db
Binary file not shown.
1 change: 1 addition & 0 deletions database/models/media_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class media_table():
filename = sqlalchemy.Column(sqlalchemy.String)
size = sqlalchemy.Column(sqlalchemy.Integer, default=None)
media_type = sqlalchemy.Column(sqlalchemy.String)
preview = sqlalchemy.Column(sqlalchemy.Integer, default=0)
downloaded = sqlalchemy.Column(sqlalchemy.Integer, default=0)
created_at = sqlalchemy.Column(sqlalchemy.DATETIME)

Expand Down

0 comments on commit ed448d9

Please sign in to comment.