Skip to content

Commit

Permalink
SYS-437 increase files/backups id values to BIGINT
Browse files Browse the repository at this point in the history
  • Loading branch information
instantlinux committed Aug 20, 2019
1 parent affc5eb commit 339e9ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ cryptography==2.3.1
docopt==0.6.2
PyMySQL==0.9.3
six==1.11.0
SQLAlchemy==1.3.6
SQLAlchemy==1.3.7
urllib3==1.25.3
2 changes: 1 addition & 1 deletion secondshot/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.9.5'
__version__ = '0.9.6'
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def upgrade():
)
op.create_table(
'files',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('id', sa.BIGINT(), autoincrement=True, nullable=False),
sa.Column('path', sa.String(length=1023), nullable=False),
sa.Column('filename', sa.String(length=255), nullable=False),
sa.Column('owner', sa.String(length=48), nullable=True),
Expand Down Expand Up @@ -105,10 +105,10 @@ def upgrade():
unique=False)
op.create_table(
'backups',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('id', sa.BIGINT(), autoincrement=True, nullable=False),
sa.Column('saveset_id', sa.INTEGER(), nullable=False),
sa.Column('volume_id', sa.INTEGER(), nullable=False),
sa.Column('file_id', sa.INTEGER(), nullable=False),
sa.Column('file_id', sa.BIGINT(), nullable=False),
sa.ForeignKeyConstraint(['file_id'], [u'files.id'], ),
sa.ForeignKeyConstraint(['saveset_id'], [u'savesets.id'],
ondelete='CASCADE'),
Expand Down
4 changes: 3 additions & 1 deletion secondshot/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
from sqlalchemy import BIGINT, BOOLEAN, Column, Enum, Float, ForeignKey, \
INTEGER, Index, String, TIMESTAMP, text, VARBINARY
from sqlalchemy import func
from sqlalchemy.dialects import sqlite
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata
BigIntId = BIGINT().with_variant(sqlite.INTEGER(), 'sqlite')


class ConfigTable(Base):
Expand Down Expand Up @@ -50,7 +52,7 @@ class File(Base):
'uid', 'gid', unique=True),
)

id = Column(INTEGER, primary_key=True, nullable=False, unique=True,
id = Column(BigIntId, primary_key=True, nullable=False, unique=True,
autoincrement=True)
path = Column(String(1023), nullable=False)
filename = Column(String(255), nullable=False)
Expand Down

0 comments on commit 339e9ee

Please sign in to comment.