fix: cover portable migration tables in logical schema

This commit is contained in:
HsungKayphoon
2026-05-16 15:58:41 +08:00
parent 4b12ec8913
commit 527feb69db
8 changed files with 3162 additions and 7 deletions

View File

@@ -554,6 +554,269 @@ columns = ["user_id"]
name = "usage_wallet_id_idx"
columns = ["wallet_id"]
[table.usage_body_blobs]
domain = "usage"
order = 12
primary_key = ["body_ref"]
[[table.usage_body_blobs.columns]]
name = "body_ref"
type = "text"
length = 160
[[table.usage_body_blobs.columns]]
name = "request_id"
type = "text"
length = 128
[[table.usage_body_blobs.columns]]
name = "body_field"
type = "text"
length = 64
[[table.usage_body_blobs.columns]]
name = "payload_gzip"
type = "bytes"
[[table.usage_body_blobs.columns]]
name = "created_at"
type = "timestamp"
default = { raw = "CURRENT_TIMESTAMP" }
driver = { mysql = { type = "TIMESTAMP" }, sqlite = { type = "TEXT" } }
[[table.usage_body_blobs.columns]]
name = "updated_at"
type = "timestamp"
default = { raw = "CURRENT_TIMESTAMP" }
driver = { mysql = { type = "TIMESTAMP" }, sqlite = { type = "TEXT" } }
[[table.usage_body_blobs.uniques]]
name = "usage_body_blobs_request_id_field_key"
columns = ["request_id", "body_field"]
[[table.usage_body_blobs.indexes]]
name = "usage_body_blobs_request_id_idx"
columns = ["request_id"]
[[table.usage_body_blobs.foreign_keys]]
name = "usage_body_blobs_request_id_fkey"
columns = ["request_id"]
references_table = "usage"
references_columns = ["request_id"]
on_delete = "cascade"
[table.usage_http_audits]
domain = "usage"
order = 14
primary_key = ["request_id"]
[[table.usage_http_audits.columns]]
name = "request_id"
type = "text"
length = 128
[[table.usage_http_audits.columns]]
name = "request_headers"
type = "json"
nullable = true
[[table.usage_http_audits.columns]]
name = "provider_request_headers"
type = "json"
nullable = true
[[table.usage_http_audits.columns]]
name = "response_headers"
type = "json"
nullable = true
[[table.usage_http_audits.columns]]
name = "client_response_headers"
type = "json"
nullable = true
[[table.usage_http_audits.columns]]
name = "request_body_ref"
type = "text"
length = 160
nullable = true
[[table.usage_http_audits.columns]]
name = "provider_request_body_ref"
type = "text"
length = 160
nullable = true
[[table.usage_http_audits.columns]]
name = "response_body_ref"
type = "text"
length = 160
nullable = true
[[table.usage_http_audits.columns]]
name = "client_response_body_ref"
type = "text"
length = 160
nullable = true
[[table.usage_http_audits.columns]]
name = "request_body_state"
type = "text"
length = 32
nullable = true
[[table.usage_http_audits.columns]]
name = "provider_request_body_state"
type = "text"
length = 32
nullable = true
[[table.usage_http_audits.columns]]
name = "response_body_state"
type = "text"
length = 32
nullable = true
[[table.usage_http_audits.columns]]
name = "client_response_body_state"
type = "text"
length = 32
nullable = true
[[table.usage_http_audits.columns]]
name = "body_capture_mode"
type = "text"
length = 32
default = "none"
[[table.usage_http_audits.columns]]
name = "created_at"
type = "timestamp"
default = { raw = "CURRENT_TIMESTAMP" }
driver = { mysql = { type = "TIMESTAMP" }, sqlite = { type = "TEXT" } }
[[table.usage_http_audits.columns]]
name = "updated_at"
type = "timestamp"
default = { raw = "CURRENT_TIMESTAMP" }
driver = { mysql = { type = "TIMESTAMP" }, sqlite = { type = "TEXT" } }
[[table.usage_http_audits.indexes]]
name = "usage_http_audits_updated_at_idx"
columns = ["updated_at"]
[[table.usage_http_audits.foreign_keys]]
name = "usage_http_audits_request_id_fkey"
columns = ["request_id"]
references_table = "usage"
references_columns = ["request_id"]
on_delete = "cascade"
[table.usage_routing_snapshots]
domain = "usage"
order = 16
primary_key = ["request_id"]
[[table.usage_routing_snapshots.columns]]
name = "request_id"
type = "text"
length = 128
[[table.usage_routing_snapshots.columns]]
name = "candidate_id"
type = "text"
length = 160
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "candidate_index"
type = "int64"
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "key_name"
type = "text"
length = 255
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "planner_kind"
type = "text"
length = 120
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "route_family"
type = "text"
length = 80
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "route_kind"
type = "text"
length = 80
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "execution_path"
type = "text"
length = 80
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "local_execution_runtime_miss_reason"
type = "text"
length = 120
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "selected_provider_id"
type = "text_id"
length = 64
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "selected_endpoint_id"
type = "text_id"
length = 64
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "selected_provider_api_key_id"
type = "text_id"
length = 64
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "has_format_conversion"
type = "bool"
nullable = true
[[table.usage_routing_snapshots.columns]]
name = "created_at"
type = "unix_seconds"
default = 0
[[table.usage_routing_snapshots.columns]]
name = "updated_at"
type = "unix_seconds"
default = 0
[[table.usage_routing_snapshots.indexes]]
name = "ix_usage_routing_snapshots_route_family_kind"
columns = ["route_family", "route_kind"]
[[table.usage_routing_snapshots.indexes]]
name = "ix_usage_routing_snapshots_candidate_id"
columns = ["candidate_id"]
[[table.usage_routing_snapshots.foreign_keys]]
name = "usage_routing_snapshots_request_id_fkey"
columns = ["request_id"]
references_table = "usage"
references_columns = ["request_id"]
on_delete = "cascade"
[table.usage_settlement_snapshots]
domain = "usage"
order = 20

File diff suppressed because it is too large Load Diff