Commit 978a04c0 authored by Lukas Böhm's avatar Lukas Böhm
Browse files

make download limit optional

parent f6825348
......@@ -10,7 +10,7 @@ class Share(db.Model):
id = db.Column('ID', db.String(64), primary_key=True, unique=True)
name = db.Column('Name', db.String(64), nullable=True)
expires = db.Column('Expires', db.DateTime, nullable=True)
download_limit = db.Column('DownloadLimit', db.Integer, nullable=False)
download_limit = db.Column('DownloadLimit', db.Integer, nullable=True)
is_public = db.Column('Public', db.Boolean, nullable=False, default=False)
password = db.Column('Password', db.String, nullable=True)
is_zipped = db.Column('Zipped', db.Boolean, nullable=False, default=False)
......@@ -45,7 +45,7 @@ class Attachment(db.Model):
id = db.Column('ID', db.INTEGER, primary_key=True, unique=True)
filename = db.Column('filename', db.String(), nullable=False)
filesize = db.Column('filesize', db.Integer(), nullable=False, default=0)
filesize = db.Column('filesize', db.Integer(), nullable=False, default=0) # in bytes
share_id = db.Column('ShareID', db.String(64), db.ForeignKey('Share.ID'), nullable=False)
def __repr__(self):
......
"""optional download limit
Revision ID: 6dd5e3c32463
Revises: cbc456705c64
Create Date: 2021-01-03 06:39:12.968974
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6dd5e3c32463'
down_revision = 'cbc456705c64'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('Share', 'DownloadLimit',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('Share', 'DownloadLimit',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment