← All tables
mdl_files
TRANSFORMFile metadata · 20 columnsProposed target
file_assets + file_links
Migration rule
Copy file binaries from moodledata/object store; map contenthash and context ownership
Verification required
SQL dump does not contain binaries. Need moodledata, file export, hash validation and private-file access design.
Tracking
Sign in to update status, owner and notes.
| Column | Type | Null | Default | Target mapping | Risk |
|---|---|---|---|---|---|
| id | bigint | Not null | Preserve as legacy source ID; generate target PK unless target accepts stable legacy key. | High: verify semantics/relationship/security | |
| contenthash | varchar(40) | Not null | '' | Transform text/JSON/HTML as appropriate; sanitize and rewrite embedded Moodle URLs/file references. | High: verify semantics/relationship/security |
| pathnamehash | varchar(40) | Not null | '' | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference |
| contextid | bigint | Not null | Resolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs. | High: verify semantics/relationship/security | |
| component | varchar(100) | Not null | '' | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference |
| filearea | varchar(50) | Not null | '' | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference |
| itemid | bigint | Not null | Resolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs. | High: verify semantics/relationship/security | |
| filepath | varchar(255) | Not null | '' | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference |
| filename | varchar(255) | Not null | '' | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference |
| userid | bigint | Nullable | Resolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs. | High: verify semantics/relationship/security | |
| filesize | bigint | Not null | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference | |
| mimetype | varchar(100) | Nullable | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference | |
| status | bigint | Not null | '0' | Map through explicit enum/boolean translation; retain source value and test edge cases. | High: verify semantics/relationship/security |
| source | longtext | Nullable | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference | |
| author | varchar(255) | Nullable | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference | |
| license | varchar(255) | Nullable | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference | |
| timecreated | bigint | Not null | Convert Unix epoch to UTC timestamp; verify 0/null sentinel and date semantics. | Schema-only inference | |
| timemodified | bigint | Not null | Convert Unix epoch to UTC timestamp; verify 0/null sentinel and date semantics. | Schema-only inference | |
| sortorder | bigint | Not null | '0' | Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning. | Schema-only inference |
| referencefileid | bigint | Nullable | Resolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs. | High: verify semantics/relationship/security |