Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,5 @@ Code reviews are required for all submissions via GitHub pull requests.


- I do not want you to be in the co-author signoff
- make sure all go code is go-fmt
- make sure all go code is go-fmt
- when the schema is changed, run make generate, do not create a migration explicitly
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Modify "attestations" table
ALTER TABLE "attestations" DROP CONSTRAINT "attestations_workflow_runs_attestation_bundle", ADD CONSTRAINT "attestations_workflow_runs_attestation_bundle" FOREIGN KEY ("workflowrun_id") REFERENCES "workflow_runs" ("id") ON UPDATE NO ACTION ON DELETE CASCADE;
3 changes: 2 additions & 1 deletion app/controlplane/pkg/data/ent/migrate/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:CR4ZZX0wKUI9H+dldKzHZ2IkDpnRSTyssXoCkVJk31g=
h1:QaClWT8b1Nr8BRNI+5O2WAYbWl/5tTlopLggA6RQwzw=
20230706165452_init-schema.sql h1:VvqbNFEQnCvUVyj2iDYVQQxDM0+sSXqocpt/5H64k8M=
20230710111950-cas-backend.sql h1:A8iBuSzZIEbdsv9ipBtscZQuaBp3V5/VMw7eZH6GX+g=
20230712094107-cas-backends-workflow-runs.sql h1:a5rzxpVGyd56nLRSsKrmCFc9sebg65RWzLghKHh5xvI=
Expand Down Expand Up @@ -107,3 +107,4 @@ h1:CR4ZZX0wKUI9H+dldKzHZ2IkDpnRSTyssXoCkVJk31g=
20250808164000.sql h1:T6Yt5JhbfB+7iY4WPpeCEsT3G5wplxTBB64De3ZXNus=
20250808164400.sql h1:r7S2LM8d3kbKQ7WNuggjvmNw3kcccx0rYzzklw8Q2I8=
20250808165202.sql h1:Oreh9FpYwo/cdcs3Oza/+ACzScXeTRBGIEvua8RqoLo=
20250812111458.sql h1:15yQlZoBymYR5GEjGLtV/j4ZZjg06u6eEzcRRl7vax4=
2 changes: 1 addition & 1 deletion app/controlplane/pkg/data/ent/migrate/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var (
Symbol: "attestations_workflow_runs_attestation_bundle",
Columns: []*schema.Column{AttestationsColumns[3]},
RefColumns: []*schema.Column{WorkflowRunsColumns[0]},
OnDelete: schema.NoAction,
OnDelete: schema.Cascade,
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion app/controlplane/pkg/data/ent/schema/workflowrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (WorkflowRun) Edges() []ent.Edge {
edge.To("cas_backends", CASBackend.Type),
// not required since we have old data
edge.From("version", ProjectVersion.Type).Field("version_id").Ref("runs").Unique().Required(),
edge.To("attestation_bundle", Attestation.Type).Unique(),
edge.To("attestation_bundle", Attestation.Type).Unique().Annotations(entsql.Annotation{OnDelete: entsql.Cascade}),
}
}

Expand Down
Loading