@@ -3,6 +3,7 @@ package schema
3
3
import (
4
4
"entgo.io/contrib/entgql"
5
5
"entgo.io/ent"
6
+ "entgo.io/ent/dialect/entsql"
6
7
"entgo.io/ent/schema"
7
8
"entgo.io/ent/schema/edge"
8
9
)
@@ -27,43 +28,73 @@ func (Metrics) Edges() []ent.Edge {
27
28
28
29
// The action summmary with details about actions executed.
29
30
edge .To ("action_summary" , ActionSummary .Type ).
30
- Unique (),
31
+ Unique ().
32
+ Annotations (
33
+ entsql .OnDelete (entsql .Cascade ),
34
+ ),
31
35
32
36
// Details about memory usage and garbage collections.
33
37
edge .To ("memory_metrics" , MemoryMetrics .Type ).
34
- Unique (),
38
+ Unique ().
39
+ Annotations (
40
+ entsql .OnDelete (entsql .Cascade ),
41
+ ),
35
42
36
43
// Target metrics.
37
44
edge .To ("target_metrics" , TargetMetrics .Type ).
38
- Unique (),
45
+ Unique ().
46
+ Annotations (
47
+ entsql .OnDelete (entsql .Cascade ),
48
+ ),
39
49
40
50
// Package metrics.
41
51
edge .To ("package_metrics" , PackageMetrics .Type ).
42
- Unique (),
52
+ Unique ().
53
+ Annotations (
54
+ entsql .OnDelete (entsql .Cascade ),
55
+ ),
43
56
44
57
// Timing metrics.
45
58
edge .To ("timing_metrics" , TimingMetrics .Type ).
46
- Unique (),
59
+ Unique ().
60
+ Annotations (
61
+ entsql .OnDelete (entsql .Cascade ),
62
+ ),
47
63
48
64
// Cumulative metrics.
49
65
edge .To ("cumulative_metrics" , CumulativeMetrics .Type ).
50
- Unique (),
66
+ Unique ().
67
+ Annotations (
68
+ entsql .OnDelete (entsql .Cascade ),
69
+ ),
51
70
52
71
// Artifact metrics.
53
72
edge .To ("artifact_metrics" , ArtifactMetrics .Type ).
54
- Unique (),
73
+ Unique ().
74
+ Annotations (
75
+ entsql .OnDelete (entsql .Cascade ),
76
+ ),
55
77
56
78
// Network metrics if available.
57
79
edge .To ("network_metrics" , NetworkMetrics .Type ).
58
- Unique (),
80
+ Unique ().
81
+ Annotations (
82
+ entsql .OnDelete (entsql .Cascade ),
83
+ ),
59
84
60
85
// Dynamic execution metrics if available.
61
86
edge .To ("dynamic_execution_metrics" , DynamicExecutionMetrics .Type ).
62
- Unique (),
87
+ Unique ().
88
+ Annotations (
89
+ entsql .OnDelete (entsql .Cascade ),
90
+ ),
63
91
64
92
// Build graph metrics.
65
93
edge .To ("build_graph_metrics" , BuildGraphMetrics .Type ).
66
- Unique (),
94
+ Unique ().
95
+ Annotations (
96
+ entsql .OnDelete (entsql .Cascade ),
97
+ ),
67
98
}
68
99
}
69
100
0 commit comments