diff --git a/falcano/model.py b/falcano/model.py index e25aae2..933b7d7 100644 --- a/falcano/model.py +++ b/falcano/model.py @@ -369,6 +369,14 @@ def get_schema(cls): TABLE_NAME: cls.Meta.table_name, BILLING_MODE: cls.Meta.billing_mode } + + # Adds capacity units to table if billing mode is PROVISIONED_THROUGHPUT + if cls.Meta.billing_mode != PAY_PER_REQUEST_BILLING_MODE: + schema[PROVISIONED_THROUGHPUT] = { + READ_CAPACITY_UNITS: cls.Meta.read_capacity_units, + WRITE_CAPACITY_UNITS: cls.Meta.write_capacity_units, + } + for attr_name, attr_cls in cls.get_attributes(): if attr_cls.is_hash_key or attr_cls.is_range_key: schema[ATTR_DEFINITIONS].append({