← All tables

mdl_context

TRANSFORMMoodle context hierarchy · 6 columns

Proposed target

legacy_context_map (migration only) + target ownership links

Migration rule

Use context to resolve course/module/user ownership and file scope

Verification required

Do not reproduce Moodle context table as runtime RBAC without a designed target permission model.

Tracking

Sign in to update status, owner and notes.

ColumnTypeNullDefaultTarget mappingRisk
idbigintNot nullPreserve as legacy source ID; generate target PK unless target accepts stable legacy key.High: verify semantics/relationship/security
contextlevelbigintNot null'0'Transform text/JSON/HTML as appropriate; sanitize and rewrite embedded Moodle URLs/file references.Schema-only inference
instanceidbigintNot null'0'Resolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs.High: verify semantics/relationship/security
pathvarchar(255)NullableMap same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
depthtinyintNot null'0'Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
lockedtinyintNot null'0'Map through explicit enum/boolean translation; retain source value and test edge cases.Schema-only inference