class ProjectionOverlap(BaseModel): hash = Column(Integer, hash_key=True) range = Column(Integer, range_key=True) other = Column(Integer) by_other = GlobalSecondaryIndex(projection=["other", "range"], hash_key="other")
class GroupActivity(db.Model): id = Column(String, hash_key=True) group_id = Column(String) type = Column(String) object = Column(String) by_group = GlobalSecondaryIndex(projection="all", hash_key="group_id")
class User(BaseModel): id = Column(String, hash_key=True) age = Column(Integer) name = Column(String) email = Column(String) joined = Column(DateTime, dynamo_name="j") by_email = GlobalSecondaryIndex(hash_key="email", projection="all")
class MyModel(BaseModel): id = Column(Integer, hash_key=True) email = Column(String) password = Column(String, default=token_hex) by_email = GlobalSecondaryIndex(projection="keys", hash_key="email")
class Model(new_base()): id = Column(UUID, hash_key=True) other = Column(DateTime, range_key=True) another = Column(UUID) last = Column(String) by_last = GlobalSecondaryIndex(hash_key="another", range_key="last") by_another = LocalSecondaryIndex(range_key="last")
class SecondOverlap(BaseModel): class Meta: table_name = "overlap-table" id = Column(Integer, hash_key=True) second_value = Column(Integer) second_index = GlobalSecondaryIndex(projection="keys", hash_key="second_value")
class MixinUser(MixinBase, IdentityMixin): first_name = Column(String) last_name = Column(String) by_email = GlobalSecondaryIndex(projection='all', dynamo_name='email-index', hash_key='email') def __str__(self): return "{} {}: {}".format(self.first_name, self.last_name, self.email)
class ProjectedIndexes(BaseModel): h = Column(Integer, hash_key=True) r = Column(Integer, range_key=True) both = Column(String) neither = Column(String) gsi_only = Column(String) lsi_only = Column(String) by_gsi = GlobalSecondaryIndex(hash_key="h", projection=["both", "gsi_only"]) by_lsi = LocalSecondaryIndex(range_key="r", projection=["both", "lsi_only"])
class ImplicitValues(BaseModel): class Meta: write_units = 1 table_name = "throughput-test" id = Column(Integer, hash_key=True) other = Column(Integer) by_other = GlobalSecondaryIndex(projection="keys", hash_key=other, write_units=1)
class Tweet(Base): class Meta: write_units = 10 account = Column(UUID, hash_key=True) id = Column(String, range_key=True) content = Column(String) date = Column(DateTime(timezone='EU/Paris')) favorites = Column(Integer) by_date = GlobalSecondaryIndex(hash_key='date', projection='keys_only')
class Account(Base): class Meta: read_units = 5 write_units = 2 id = Column(UUID, hash_key=True) name = Column(String) email = Column(String) by_email = GlobalSecondaryIndex(hash_key='email', projection='keys_only', write_units=1, read_units=5)
class User(BaseModel): class Meta: read_units = 1 write_units = 3 email = Column(String, hash_key=True) username = Column(String, range_key=True) by_username = GlobalSecondaryIndex(projection="keys", hash_key="username") profile = Column(String) data = Column(DynamicMap) extra = Column(String)
class ComplexModel(BaseModel): class Meta: write_units = 2 read_units = 3 table_name = "CustomTableName" name = Column(UUID, hash_key=True) date = Column(String, range_key=True) email = Column(String) joined = Column(String) not_projected = Column(Integer) by_email = GlobalSecondaryIndex(hash_key="email", read_units=4, projection="all", write_units=5) by_joined = LocalSecondaryIndex(range_key="joined", projection=["email"])
class Brand(BaseModel): class Meta: table_name = 'brewoptix-brands' read_units = 20 write_units = 20 # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # Api attrs name = Column(String) supplier_id = Column(UUID) by_brand_name = GlobalSecondaryIndex(projection='all', hash_key='name', read_units=20, write_units=20) by_supplier_id = GlobalSecondaryIndex(projection='all', hash_key='supplier_id', read_units=20, write_units=20)
class PurchaseOrder(BaseModel): class Meta: table_name = 'brewoptix-purchase-orders' read_units_min = 2 read_units_max = 20 write_units_min = 2 write_units_max = 20 autoscale_table = True autoscale_all_indices = True # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # API Attrs supplier_id = Column(UUID) distributor_id = Column(UUID) order_date = Column(Number) pack_date = Column(Number) ship_date = Column(Number) by_supplier_id_and_order_date = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', range_key='order_date', ) by_supplier_id_and_pack_date = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', range_key='pack_date', ) by_supplier_id_and_ship_date = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', range_key='ship_date', ) by_distributor_id_and_order_date = GlobalSecondaryIndex( projection='all', hash_key='distributor_id', range_key='order_date', ) by_distributor_id_and_pack_date = GlobalSecondaryIndex( projection='all', hash_key='distributor_id', range_key='pack_date', ) by_distributor_id_and_ship_date = GlobalSecondaryIndex( projection='all', hash_key='distributor_id', range_key='ship_date', )
class Product(BaseModel): class Meta: table_name = 'brewoptix-products' read_units = 20 write_units = 20 # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # Api attrs supplier_id = Column(UUID) by_supplier_id = GlobalSecondaryIndex(projection='all', hash_key='supplier_id', read_units=20, write_units=20)
class OnHand(BaseModel): class Meta: table_name = 'brewoptix-on-hand-inventory' read_units = 20 write_units = 20 # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # API Attrs supplier_id = Column(UUID) product_id = Column(UUID) by_supplier_id = GlobalSecondaryIndex(projection='all', hash_key='supplier_id', read_units=20, write_units=20)
class SupplierDistributor(BaseModel): class Meta: table_name = 'brewoptix-supplier-distributors' read_units = 20 write_units = 20 # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # Api attrs supplier_id = Column(UUID) name = Column(String) by_supplier_id = GlobalSecondaryIndex(projection='all', hash_key='supplier_id', read_units=20, write_units=20)
class Production(BaseModel): class Meta: table_name = 'brewoptix-production' read_units = 20 write_units = 20 # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # Api attrs supplier_id = Column(UUID) production_date = Column(Number) # unix timestamp by_supplier_id_and_production_date = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', range_key='production_date', read_units=20, write_units=20)
class Count(BaseModel): class Meta: table_name = 'brewoptix-counts' read_units = 20 write_units = 20 # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # API Attrs supplier_id = Column(UUID) count_date = Column(Number) by_supplier_id_and_count_date = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', range_key='count_date', read_units=20, write_units=20)
class PackageType(BaseModel): class Meta: table_name = 'brewoptix-package-types' read_units_min = 2 read_units_max = 20 write_units_min = 2 write_units_max = 20 autoscale_table = True autoscale_all_indices = True # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # Api attrs supplier_id = Column(UUID) by_supplier_id = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', )
class OnHand(BaseModel): class Meta: table_name = 'brewoptix-on-hand-inventory' read_units_min = 2 read_units_max = 20 write_units_min = 2 write_units_max = 20 autoscale_table = True autoscale_all_indices = True # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # API Attrs supplier_id = Column(UUID) product_id = Column(UUID) by_supplier_id = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', )
class Adjustment(BaseModel): class Meta: table_name = 'brewoptix-adjustment-inventory' read_units_min = 2 read_units_max = 20 write_units_min = 2 write_units_max = 20 autoscale_table = True autoscale_all_indices = True # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # API Attrs supplier_id = Column(UUID) adjustment_date = Column(Number) by_supplier_id_and_adjustment_date = GlobalSecondaryIndex( projection='all', hash_key='supplier_id', range_key='adjustment_date', )
class DistributorSupplier(BaseModel): class Meta: table_name = 'brewoptix-distributor-suppliers' read_units_min = 2 read_units_max = 20 write_units_min = 2 write_units_max = 20 autoscale_table = True autoscale_all_indices = True # big 7 entity_id = Column(UUID, hash_key=True) version = Column(UUID, range_key=True) # Api attrs distributor_id = Column(UUID) supplier_distributor_id = Column(UUID) supplier_id = Column(UUID) nickname = Column(String) by_distributor_id = GlobalSecondaryIndex( projection='all', hash_key='distributor_id', )
class ExternalUser(MixinUser): company = Column(String) by_email = GlobalSecondaryIndex(projection='all', dynamo_name='email-index', hash_key=MixinUser.email)
class NextGenUser(MixinUser): version = Column(Integer) next_by_email = GlobalSecondaryIndex(projection='all', dynamo_name='email-index', hash_key='email')