Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MorphMany failure #148

Open
jmverges opened this issue May 3, 2024 · 2 comments
Open

MorphMany failure #148

jmverges opened this issue May 3, 2024 · 2 comments
Assignees
Labels

Comments

@jmverges
Copy link

jmverges commented May 3, 2024

  • Laravel version: 8.83.16
  • Laravel Soft Cascade Version: 8.1.0

Description:

I'm using a polymorphic

    public function files(): MorphMany
    {
        return $this->morphMany(File::class, 'files', 'fileable_type', 'fileable_id');
    }

but it seems not to work.

It says

Column not found: 1054 Unknown column 'entry.deleted_at' in 'field list' (SQL: update `files` set `entry`.`deleted_at` = 2024-05-03 14:31:15, `files`.`updated_at` = 2024-05-03 14:31:15 where `id` in (1998334, 1998335, 1998336, 1998337, 1998338, 1998339, 1998340, 1998341, 1998342, 1998343, 1998344, 1998345, 1998346, 1998347, 1998348, 1998349, 1998350, 1998351, 1998352, 1998353, 1998354, 1998355, 1998357, 1998358, 1998359, 1998360, 1998474, 1998475, 1998669, 1998670) limit 30)", message: "Internal server error", extensions: { category: "internal" }, locations: [[Object]], path: ["doEntry"], trace: [[Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], ... 75 more items] }

Entry is the model that includes the trait and Files is the model that needs to be deleted on cascade

I'm seeing this issues here and seems the same

#109
#31

Any help here?

@jmverges
Copy link
Author

jmverges commented May 9, 2024

@gcphost @maguilar92 any feedback?

@jmverges
Copy link
Author

I have a $model->myRelation()->delete() model in myRelation() is the one with softcascade with files table
update my_relation.deleted_at="2023-05-15 12:00:00" not found in files
Somehow it wants to update set my_relation.deleted_at instead of files.deleted_at

@Yogarine Yogarine added the bug label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants