#196 Apps: Database migrations for app system tables
Description
Edit## Parent Epic: #195
## Description
Create database migrations for the app system tables.
## Tables to Create
### 1. highway.apps
Core app registry table with fields:
- app_id (UUID PK)
- app_name, publisher_id (unique together)
- display_name, description, icon_url, documentation_url
- category, tags (JSONB), visibility
- is_verified, is_builtin, status
- timestamps and created_by
### 2. highway.app_versions
Immutable version snapshots:
- version_id (UUID PK)
- app_id (FK), version (semver)
- version_major/minor/patch/prerelease
- definition_hash, definition (JSONB)
- entrypoint_type, entrypoint_config (JSONB)
- required_permissions, required_secrets, configuration_schema (JSONB)
- actions (JSONB) - exposed methods
- status (draft/published/deprecated)
- changelog, breaking_changes, migration_guide
### 3. highway.tenant_app_installations
Per-tenant installations:
- installation_id (UUID PK)
- tenant_id, app_id (FK), version_id (FK)
- auto_update, update_channel
- configuration, secrets_config (JSONB)
- status, usage tracking
- timestamps
### 4. highway.app_execution_log (partitioned)
Audit trail for app executions:
- Partitioned by created_at
- tenant_id, workflow_run_id, task_id
- app_id, version_id, action_name
- status, timing, I/O summaries, errors
- tracing fields
## Migration File
engine/migrations/sql/highway_0.0.60_apps.sql
## Indexes Required
- All foreign keys indexed
- Composite indexes for common queries
- GIN indexes for JSONB search
- Partial indexes for active/enabled records
## Testing
- Migration applies cleanly
- Rollback works
- FK constraints enforced
- Unique constraints work
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...