See the solution below
The relationship field is required on all detail records. Once the value of the relationship field has been saved, it cannot be changed. The ownership and sharing of a detail record are determined by the master record. When a user deletes the master record, all detail records are deleted. You can create rollup summary fields on the master record to summarize the detail records.