DynamoDB tables

Tables are defined in actionstools_app/init.py (dynamo_tables) and accessed through flask-dynamo. They are not managed by the SAM stack; GET /setup-install can create missing ones in a fresh environment.

Naming

Table Production (ENV_NAME=production) Every other env

notes

em_actions_notes2

em_actions_notes_staging

comments, files, settings, counters, tasks, tasks_counters, notifications

em_actions_<name>

em_actions_<name>_staging

The suffix is chosen from ENV_NAME in code; the table names in the Env mapping of template.yaml must match it for IAM to allow access. Local runs use the _staging tables of whatever account the credentials point at.

Tables

Table Key Indexes

notes

target_uuid / uuid

GSI owner_uuid-created_at, instance_id-uuid, target_uuid-updated_at; LSI target_uuid-is_pinned-index

comments

target_uuid / uuid

GSI owner_uuid-created_at; LSI target_uuid-created_at-index

files

target_uuid / uuid

GSI target_uuid-created_at, owner_uuid-created_at

settings

instance_id / config_key

GSI instance_id-config_type, category-created_at

tasks

instance_id / uuid

GSI target_uuid-created_at, target_uuid-updated_at, owner_uuid-created_at, assignee_uuid-created_at, status-created_at; LSI instance_id-created_at, instance_id-created_by, instance_id-updated_at, instance_id-assignee_name, instance_id-status, instance_id-created_at-index-copy (projection subset), instance_id-uuid. Stream: NEW_AND_OLD_IMAGES.

counters

counter_seq_key

— (task item_number sequence)

tasks_counters

counter_seq_key

— (filter counters, ExpirationTime TTL attribute)

notifications

target_uuid / uuid

GSI target_uuid-created_at, target_uuid-is_read, target_uuid-is_hidden

All index names end in -index (for example target_uuid-created_at-index); the constants are INDEX_* in actionstools_app/init.py.

Item conventions

  • uuid is generated on create; created_at / updated_at are set by the CRUD service. Tasks use integer epoch seconds (use_timestamps=True); the other tables use str(datetime.utcnow()).

  • Deletes are soft: deleted_at is set and the item is filtered out of reads.

  • Free-form payload (data, or config_value for settings) is stored in marshalled DynamoDB form and unmarshalled on read.

  • Owner-only changes are checked with OwnerValidator against the Payability internal API; CRM_ADMIN users may change anything.