diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go index eeb63a4..fc16256 100644 --- a/ent/migrate/schema.go +++ b/ent/migrate/schema.go @@ -159,7 +159,7 @@ var ( Symbol: "multistream_infos_playlists_multistream_info", Columns: []*schema.Column{MultistreamInfosColumns[3]}, RefColumns: []*schema.Column{PlaylistsColumns[0]}, - OnDelete: schema.NoAction, + OnDelete: schema.Cascade, }, }, } diff --git a/ent/schema/playlist.go b/ent/schema/playlist.go index e8a9c4a..3808f8d 100644 --- a/ent/schema/playlist.go +++ b/ent/schema/playlist.go @@ -4,6 +4,7 @@ import ( "time" "entgo.io/ent" + "entgo.io/ent/dialect/entsql" "entgo.io/ent/schema/edge" "entgo.io/ent/schema/field" "github.com/google/uuid" @@ -30,6 +31,6 @@ func (Playlist) Fields() []ent.Field { func (Playlist) Edges() []ent.Edge { return []ent.Edge{ edge.To("vods", Vod.Type), - edge.To("multistream_info", MultistreamInfo.Type), + edge.To("multistream_info", MultistreamInfo.Type).Annotations(entsql.OnDelete(entsql.Cascade)), } }