Commit Graph

3 Commits

Author SHA1 Message Date
Luca Sacchi Ricciardi
216f9e229c feat(database): seed AWS pricing data
Populate aws_pricing table with real AWS pricing for:

Services:
- SQS: /bin/bash.40 per million requests
- Lambda: /bin/bash.20 per million requests + /bin/bash.0000166667 per GB-second
- Bedrock Claude 3 Sonnet: /bin/bash.003 input / /bin/bash.015 output per 1K tokens

Regions:
- us-east-1 (N. Virginia)
- eu-west-1 (Ireland)

Total: 10 pricing records inserted

Task: DB-007 complete
All database tasks (DB-001 to DB-007) now complete!

Next: Backend team can proceed with SQLAlchemy models and repositories.
2026-04-07 13:55:30 +02:00
Luca Sacchi Ricciardi
26fb4a276f feat(database): create all core tables with migrations
Add database migrations for mockupAWS v0.2.0:

- DB-003: scenario_logs table
  * Stores received log entries with SHA256 hash for deduplication
  * PII detection flags
  * Metrics: size_bytes, token_count, sqs_blocks
  * Indexes on scenario_id, received_at, message_hash, has_pii

- DB-004: scenario_metrics table
  * Time-series storage for metrics aggregation
  * Supports: sqs, lambda, bedrock, safety metric types
  * Flexible JSONB metadata field
  * BRIN index on timestamp for efficient queries

- DB-005: aws_pricing table
  * Stores AWS service pricing by region
  * Supports price history with effective_from/to dates
  * Active pricing flag for current rates
  * Index on service, region, tier combination

- DB-006: reports table
  * Generated report tracking
  * Supports PDF and CSV formats
  * File path and size tracking
  * Metadata JSONB for extensibility

All tables include:
- UUID primary keys with auto-generation
- Foreign key constraints with CASCADE delete
- Appropriate indexes for query performance
- Check constraints for data validation

Tasks: DB-003, DB-004, DB-005, DB-006 complete
2026-04-07 13:53:07 +02:00
Luca Sacchi Ricciardi
6f03c33ab5 feat(database): setup alembic and create scenarios table
- Install alembic and asyncpg for database migrations
- Configure alembic for async SQLAlchemy 2.0
- Create initial migration for scenarios table:
  * UUID primary key with auto-generation
  * Status enum (draft, running, completed, archived)
  * JSONB tags with GIN index
  * Timestamps with auto-update trigger
  * Check constraints for name/region validation
  * Indexes on status, region, created_at
- Test database connection and migration

Task: DB-001, DB-002 complete
2026-04-07 13:48:05 +02:00