diff --git a/CHANGELOG.md b/CHANGELOG.md index aae5a5ab..80400827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] ### Added - Configurable log and message format +- Start logging changes (without api export and WebUI currently) - issue #128 ### Changed - Replaced database migration framework - issue #115 diff --git a/server/app/models.py b/server/app/models.py index df571f49..e7891999 100644 --- a/server/app/models.py +++ b/server/app/models.py @@ -1,10 +1,15 @@ from datetime import datetime +from sqlalchemy import orm from app.server import db, bcrypt from app.modules.view_helper_for_models import nested_fields class User(db.Model): + __versioned__ = { + 'exclude': ('password_hash', ) + } + id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(30), nullable=False, unique=True, index=True) password_hash = db.Column(db.String(80), nullable=False) @@ -42,6 +47,8 @@ def get_id(self) -> str: @nested_fields(user=User) class UserConfig(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) name = db.Column(db.String(40), index=True, nullable=False) @@ -58,6 +65,8 @@ def __repr__(self)-> str: class Vendor(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(60), nullable=False, unique=True) @@ -68,6 +77,8 @@ def __repr__(self)-> str: class Unit(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) unit = db.Column(db.String(20), nullable=False, unique=True) @@ -76,6 +87,8 @@ def __repr__(self)-> str: class Customer(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(60), nullable=False, unique=True) @@ -85,6 +98,8 @@ def __repr__(self)-> str: @nested_fields(vendor=Vendor, unit=Unit) class Item(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(60), nullable=False, unique=True) vendor_id = db.Column(db.Integer, db.ForeignKey('vendor.id'), nullable=False) @@ -104,6 +119,8 @@ def __repr__(self)-> str: @nested_fields(item=Item) class Barcode(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) barcode = db.Column(db.String(15), nullable=False, unique=True, index=True) quantity = db.Column(db.Float, nullable=False, default=1.0) @@ -120,6 +137,8 @@ def __repr__(self)-> str: @nested_fields(customer=Customer, outbound_close_user=User, returned_close_user=User) class Work(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) customer_id = db.Column(db.Integer, db.ForeignKey('customer.id'), nullable=False) comment = db.Column(db.Text) @@ -162,6 +181,8 @@ def close_returned_items(self, user: User): @nested_fields(work=Work, item=Item) class WorkItem(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) work_id = db.Column(db.Integer, db.ForeignKey('work.id'), nullable=False) item_id = db.Column(db.Integer, db.ForeignKey('item.id'), nullable=False) @@ -180,6 +201,8 @@ def __repr__(self)-> str: class Acquisition(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) timestamp = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) comment = db.Column(db.Text) @@ -192,6 +215,8 @@ def __repr__(self)-> str: @nested_fields(acquisition=Acquisition, item=Item) class AcquisitionItem(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) acquisition_id = db.Column(db.Integer, db.ForeignKey('acquisition.id'), nullable=False) item_id = db.Column(db.Integer, db.ForeignKey('item.id'), nullable=False) @@ -209,6 +234,8 @@ def __repr__(self)-> str: class Stocktaking(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) timestamp = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) comment = db.Column(db.Text) @@ -236,6 +263,8 @@ def close_items(self, user: User): @nested_fields(stocktaking=Stocktaking, item=Item) class StocktakingItem(db.Model): + __versioned__ = {} + id = db.Column(db.Integer, primary_key=True) stocktaking_id = db.Column(db.Integer, db.ForeignKey('stocktaking.id'), nullable=False) item_id = db.Column(db.Integer, db.ForeignKey('item.id'), nullable=False) @@ -250,3 +279,7 @@ class StocktakingItem(db.Model): def __repr__(self)-> str: return '{!s} [{!r}]'.format(self.id, self.item) + + +# Setup SQLAlchemy-Continuum tables and hooks +orm.configure_mappers() diff --git a/server/app/modules/view_helper_for_models.py b/server/app/modules/view_helper_for_models.py index 9d0fb6ec..3d58771d 100644 --- a/server/app/modules/view_helper_for_models.py +++ b/server/app/modules/view_helper_for_models.py @@ -163,7 +163,7 @@ def __initial_enumerate_nested_fields(self, model: db.Model): if self.__nested_fields: return - relationships = inspect(model.__class__).relationships + relationships = [rel for rel in inspect(model.__class__).relationships if rel.key != 'versions'] for relationship in relationships: nested_field_name = relationship.key for local_field, remote_field in relationship.local_remote_pairs: diff --git a/server/app/server.py b/server/app/server.py index 25b7b95f..a0fc93d4 100644 --- a/server/app/server.py +++ b/server/app/server.py @@ -2,6 +2,7 @@ from flask.ext.login import LoginManager from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.bcrypt import Bcrypt +from sqlalchemy_continuum import make_versioned, plugins from app import test_mode, doc_mode, log, static from app.config import get_config, check_warnings_in_config @@ -38,6 +39,9 @@ # flask-bcrypt bcrypt = Bcrypt(app) +# SQLAlchemy-Continuum +make_versioned(plugins=[plugins.FlaskPlugin()]) + # Init views (must be after common resources) import app.views as views views.initialize_endpoints(config, api) diff --git a/server/db_migrations/versions/58d249b8b61_v0_3_0.py b/server/db_migrations/versions/58d249b8b61_v0_3_0.py new file mode 100644 index 00000000..b117bf87 --- /dev/null +++ b/server/db_migrations/versions/58d249b8b61_v0_3_0.py @@ -0,0 +1,263 @@ +"""StoreKeeper v0.3.0 + +Revision ID: 58d249b8b61 +Revises: 305c2b0084f +Create Date: 2015-12-15 21:40:26.652582 + +""" + +revision = '58d249b8b61' +down_revision = '305c2b0084f' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.create_table('acquisition_item_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('acquisition_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('item_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_acquisition_item_version_end_transaction_id'), 'acquisition_item_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_acquisition_item_version_operation_type'), 'acquisition_item_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_acquisition_item_version_transaction_id'), 'acquisition_item_version', ['transaction_id'], unique=False) + op.create_table('acquisition_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('timestamp', sa.DateTime(), autoincrement=False, nullable=True), + sa.Column('comment', sa.Text(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_acquisition_version_end_transaction_id'), 'acquisition_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_acquisition_version_operation_type'), 'acquisition_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_acquisition_version_transaction_id'), 'acquisition_version', ['transaction_id'], unique=False) + op.create_table('barcode_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('barcode', sa.String(length=15), autoincrement=False, nullable=True), + sa.Column('quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('item_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('master', sa.Boolean(), autoincrement=False, nullable=True), + sa.Column('main', sa.Boolean(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_barcode_version_barcode'), 'barcode_version', ['barcode'], unique=False) + op.create_index(op.f('ix_barcode_version_end_transaction_id'), 'barcode_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_barcode_version_operation_type'), 'barcode_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_barcode_version_transaction_id'), 'barcode_version', ['transaction_id'], unique=False) + op.create_table('customer_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('name', sa.String(length=60), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_customer_version_end_transaction_id'), 'customer_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_customer_version_operation_type'), 'customer_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_customer_version_transaction_id'), 'customer_version', ['transaction_id'], unique=False) + op.create_table('item_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('name', sa.String(length=60), autoincrement=False, nullable=True), + sa.Column('vendor_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('article_number', sa.String(length=20), autoincrement=False, nullable=True), + sa.Column('quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('warning_quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('purchase_price', sa.Float(), server_default='0', autoincrement=False, nullable=True), + sa.Column('unit_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_item_version_end_transaction_id'), 'item_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_item_version_operation_type'), 'item_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_item_version_transaction_id'), 'item_version', ['transaction_id'], unique=False) + op.create_table('stocktaking_item_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('stocktaking_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('item_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_stocktaking_item_version_end_transaction_id'), 'stocktaking_item_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_stocktaking_item_version_operation_type'), 'stocktaking_item_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_stocktaking_item_version_transaction_id'), 'stocktaking_item_version', ['transaction_id'], unique=False) + op.create_table('stocktaking_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('timestamp', sa.DateTime(), autoincrement=False, nullable=True), + sa.Column('comment', sa.Text(), autoincrement=False, nullable=True), + sa.Column('close_timestamp', sa.DateTime(), autoincrement=False, nullable=True), + sa.Column('close_user_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_stocktaking_version_end_transaction_id'), 'stocktaking_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_stocktaking_version_operation_type'), 'stocktaking_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_stocktaking_version_transaction_id'), 'stocktaking_version', ['transaction_id'], unique=False) + op.create_table('unit_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('unit', sa.String(length=20), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_unit_version_end_transaction_id'), 'unit_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_unit_version_operation_type'), 'unit_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_unit_version_transaction_id'), 'unit_version', ['transaction_id'], unique=False) + op.create_table('user_config_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('user_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('name', sa.String(length=40), autoincrement=False, nullable=True), + sa.Column('value', sa.String(length=200), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_user_config_version_end_transaction_id'), 'user_config_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_user_config_version_name'), 'user_config_version', ['name'], unique=False) + op.create_index(op.f('ix_user_config_version_operation_type'), 'user_config_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_user_config_version_transaction_id'), 'user_config_version', ['transaction_id'], unique=False) + op.create_table('user_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('username', sa.String(length=30), autoincrement=False, nullable=True), + sa.Column('password_hash', sa.String(length=80), autoincrement=False, nullable=True), + sa.Column('email', sa.String(length=50), autoincrement=False, nullable=True), + sa.Column('admin', sa.Boolean(), autoincrement=False, nullable=True), + sa.Column('disabled', sa.Boolean(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_user_version_end_transaction_id'), 'user_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_user_version_operation_type'), 'user_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_user_version_transaction_id'), 'user_version', ['transaction_id'], unique=False) + op.create_index(op.f('ix_user_version_username'), 'user_version', ['username'], unique=False) + op.create_table('vendor_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('name', sa.String(length=60), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_vendor_version_end_transaction_id'), 'vendor_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_vendor_version_operation_type'), 'vendor_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_vendor_version_transaction_id'), 'vendor_version', ['transaction_id'], unique=False) + op.create_table('work_item_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('work_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('item_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('outbound_quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('returned_quantity', sa.Float(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_work_item_version_end_transaction_id'), 'work_item_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_work_item_version_operation_type'), 'work_item_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_work_item_version_transaction_id'), 'work_item_version', ['transaction_id'], unique=False) + op.create_table('work_version', + sa.Column('id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('customer_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('comment', sa.Text(), autoincrement=False, nullable=True), + sa.Column('outbound_close_timestamp', sa.DateTime(), autoincrement=False, nullable=True), + sa.Column('outbound_close_user_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('returned_close_timestamp', sa.DateTime(), autoincrement=False, nullable=True), + sa.Column('returned_close_user_id', sa.Integer(), autoincrement=False, nullable=True), + sa.Column('transaction_id', sa.BigInteger(), autoincrement=False, nullable=False), + sa.Column('end_transaction_id', sa.BigInteger(), nullable=True), + sa.Column('operation_type', sa.SmallInteger(), nullable=False), + sa.PrimaryKeyConstraint('id', 'transaction_id') + ) + op.create_index(op.f('ix_work_version_end_transaction_id'), 'work_version', ['end_transaction_id'], unique=False) + op.create_index(op.f('ix_work_version_operation_type'), 'work_version', ['operation_type'], unique=False) + op.create_index(op.f('ix_work_version_transaction_id'), 'work_version', ['transaction_id'], unique=False) + op.create_table('transaction', + sa.Column('issued_at', sa.DateTime(), nullable=True), + sa.Column('id', sa.BigInteger(), nullable=False), + sa.Column('remote_addr', sa.String(length=50), nullable=True), + sa.Column('user_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_transaction_user_id'), 'transaction', ['user_id'], unique=False) + + +def downgrade(): + op.drop_index(op.f('ix_transaction_user_id'), table_name='transaction') + op.drop_table('transaction') + op.drop_index(op.f('ix_work_version_transaction_id'), table_name='work_version') + op.drop_index(op.f('ix_work_version_operation_type'), table_name='work_version') + op.drop_index(op.f('ix_work_version_end_transaction_id'), table_name='work_version') + op.drop_table('work_version') + op.drop_index(op.f('ix_work_item_version_transaction_id'), table_name='work_item_version') + op.drop_index(op.f('ix_work_item_version_operation_type'), table_name='work_item_version') + op.drop_index(op.f('ix_work_item_version_end_transaction_id'), table_name='work_item_version') + op.drop_table('work_item_version') + op.drop_index(op.f('ix_vendor_version_transaction_id'), table_name='vendor_version') + op.drop_index(op.f('ix_vendor_version_operation_type'), table_name='vendor_version') + op.drop_index(op.f('ix_vendor_version_end_transaction_id'), table_name='vendor_version') + op.drop_table('vendor_version') + op.drop_index(op.f('ix_user_version_username'), table_name='user_version') + op.drop_index(op.f('ix_user_version_transaction_id'), table_name='user_version') + op.drop_index(op.f('ix_user_version_operation_type'), table_name='user_version') + op.drop_index(op.f('ix_user_version_end_transaction_id'), table_name='user_version') + op.drop_table('user_version') + op.drop_index(op.f('ix_user_config_version_transaction_id'), table_name='user_config_version') + op.drop_index(op.f('ix_user_config_version_operation_type'), table_name='user_config_version') + op.drop_index(op.f('ix_user_config_version_name'), table_name='user_config_version') + op.drop_index(op.f('ix_user_config_version_end_transaction_id'), table_name='user_config_version') + op.drop_table('user_config_version') + op.drop_index(op.f('ix_unit_version_transaction_id'), table_name='unit_version') + op.drop_index(op.f('ix_unit_version_operation_type'), table_name='unit_version') + op.drop_index(op.f('ix_unit_version_end_transaction_id'), table_name='unit_version') + op.drop_table('unit_version') + op.drop_index(op.f('ix_stocktaking_version_transaction_id'), table_name='stocktaking_version') + op.drop_index(op.f('ix_stocktaking_version_operation_type'), table_name='stocktaking_version') + op.drop_index(op.f('ix_stocktaking_version_end_transaction_id'), table_name='stocktaking_version') + op.drop_table('stocktaking_version') + op.drop_index(op.f('ix_stocktaking_item_version_transaction_id'), table_name='stocktaking_item_version') + op.drop_index(op.f('ix_stocktaking_item_version_operation_type'), table_name='stocktaking_item_version') + op.drop_index(op.f('ix_stocktaking_item_version_end_transaction_id'), table_name='stocktaking_item_version') + op.drop_table('stocktaking_item_version') + op.drop_index(op.f('ix_item_version_transaction_id'), table_name='item_version') + op.drop_index(op.f('ix_item_version_operation_type'), table_name='item_version') + op.drop_index(op.f('ix_item_version_end_transaction_id'), table_name='item_version') + op.drop_table('item_version') + op.drop_index(op.f('ix_customer_version_transaction_id'), table_name='customer_version') + op.drop_index(op.f('ix_customer_version_operation_type'), table_name='customer_version') + op.drop_index(op.f('ix_customer_version_end_transaction_id'), table_name='customer_version') + op.drop_table('customer_version') + op.drop_index(op.f('ix_barcode_version_transaction_id'), table_name='barcode_version') + op.drop_index(op.f('ix_barcode_version_operation_type'), table_name='barcode_version') + op.drop_index(op.f('ix_barcode_version_end_transaction_id'), table_name='barcode_version') + op.drop_index(op.f('ix_barcode_version_barcode'), table_name='barcode_version') + op.drop_table('barcode_version') + op.drop_index(op.f('ix_acquisition_version_transaction_id'), table_name='acquisition_version') + op.drop_index(op.f('ix_acquisition_version_operation_type'), table_name='acquisition_version') + op.drop_index(op.f('ix_acquisition_version_end_transaction_id'), table_name='acquisition_version') + op.drop_table('acquisition_version') + op.drop_index(op.f('ix_acquisition_item_version_transaction_id'), table_name='acquisition_item_version') + op.drop_index(op.f('ix_acquisition_item_version_operation_type'), table_name='acquisition_item_version') + op.drop_index(op.f('ix_acquisition_item_version_end_transaction_id'), table_name='acquisition_item_version') + op.drop_table('acquisition_item_version') diff --git a/server/requirements.txt b/server/requirements.txt index ad00ca2d..1cf9256e 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -4,6 +4,7 @@ Flask-Bcrypt>=0.6.0,<0.7 Flask-Login>=0.2.11,<0.3 Flask-RESTful>=0.3.1,<0.4 Flask-SQLAlchemy>=2.0,<3.0 +SQLAlchemy-Continuum>=1.2.2,<1.3 Flask-Migrate>=1.6.0,<1.7.0 Jinja2>=2.8.0,<2.9 marshmallow>=1.2.6,<1.3