← All tables

mdl_files

TRANSFORMFile metadata · 20 columns

Proposed 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.

ColumnTypeNullDefaultTarget mappingRisk
idbigintNot nullPreserve as legacy source ID; generate target PK unless target accepts stable legacy key.High: verify semantics/relationship/security
contenthashvarchar(40)Not null''Transform text/JSON/HTML as appropriate; sanitize and rewrite embedded Moodle URLs/file references.High: verify semantics/relationship/security
pathnamehashvarchar(40)Not null''Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
contextidbigintNot nullResolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs.High: verify semantics/relationship/security
componentvarchar(100)Not null''Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
fileareavarchar(50)Not null''Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
itemidbigintNot nullResolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs.High: verify semantics/relationship/security
filepathvarchar(255)Not null''Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
filenamevarchar(255)Not null''Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
useridbigintNullableResolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs.High: verify semantics/relationship/security
filesizebigintNot nullMap same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
mimetypevarchar(100)NullableMap same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
statusbigintNot null'0'Map through explicit enum/boolean translation; retain source value and test edge cases.High: verify semantics/relationship/security
sourcelongtextNullableMap same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
authorvarchar(255)NullableMap same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
licensevarchar(255)NullableMap same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
timecreatedbigintNot nullConvert Unix epoch to UTC timestamp; verify 0/null sentinel and date semantics.Schema-only inference
timemodifiedbigintNot nullConvert Unix epoch to UTC timestamp; verify 0/null sentinel and date semantics.Schema-only inference
sortorderbigintNot null'0'Map same-named field where semantics match; confirm target type, nullability, defaults and business meaning.Schema-only inference
referencefileidbigintNullableResolve to target foreign key via source-ID crosswalk; do not assume numeric IDs match target IDs.High: verify semantics/relationship/security