# Database Schema

This path is reserved for generated schema artifacts. A fully automated schema
export is not in place yet, so this file starts as a manually curated index of
the current model surface.

## Canonical Sources

- `backend/labs/models/*.py`
- Django migrations in `backend/labs/migrations/`

## Domain Inventory

### Lab lifecycle and access

- `lab_instance.py`
- `lab_job.py`
- `lab_ssh_authorization.py`
- `lab_ssh_server.py`
- `lab_usage.py`
- `lab_management_ssh_key.py`

### User identity and integrations

- `user.py`
- `api_key.py`
- `labs_oauth_tidbcloud_grant.py`
- `user_serverless_cluster.py`
- `serverless_branch_cluster.py`
- `serverless_main_cluster.py`

### Billing and credits

- `billing_credit_order.py`
- `billing_stripe_country_account.py`
- `billing_stripe_payment_method.py`
- `credit_transaction.py`
- `credit_voucher.py`
- `payment_order.py`
- `stripe_checkout_session.py`
- `stripe_product_price.py`
- `user_credit.py`

### Learning, exams, and certificates

- `exam.py`
- `exam_attempt.py`
- `exam_attempt_answer.py`
- `exam_attempt_section.py`
- `exam_question.py`
- `exam_section.py`
- `exam_variant.py`
- `certificate_type.py`
- `certificate_issuance.py`
- `certificate_recipient.py`
- `exam_voucher.py`

## Gap

Use this document as a map, not as an authoritative field-level schema dump,
until generation is automated.
