Skip to content

Commit

Permalink
update tasks owners, needs updated entx + gqlgen-plugins before passing
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Funkhouser <[email protected]>
  • Loading branch information
golanglemonade committed Jan 19, 2025
1 parent e820595 commit 6249acd
Show file tree
Hide file tree
Showing 41 changed files with 1,616 additions and 1,705 deletions.
2 changes: 1 addition & 1 deletion cmd/cli/cmd/task/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func createValidation() (input openlaneclient.CreateTaskInput, err error) {

organization := cmd.Config.String("organization")
if organization != "" {
input.OwnerID = &organization
input.OwnerID = organization
}

group := cmd.Config.String("group")
Expand Down
11 changes: 11 additions & 0 deletions db/migrations-goose-postgres/20250119225110_task_owner.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- +goose Up
-- modify "task_history" table
ALTER TABLE "task_history" ALTER COLUMN "owner_id" SET NOT NULL;
-- modify "tasks" table
ALTER TABLE "tasks" DROP CONSTRAINT "tasks_organizations_tasks", ALTER COLUMN "owner_id" SET NOT NULL, ADD CONSTRAINT "tasks_organizations_tasks" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION;

-- +goose Down
-- reverse: modify "tasks" table
ALTER TABLE "tasks" DROP CONSTRAINT "tasks_organizations_tasks", ALTER COLUMN "owner_id" DROP NOT NULL, ADD CONSTRAINT "tasks_organizations_tasks" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL;
-- reverse: modify "task_history" table
ALTER TABLE "task_history" ALTER COLUMN "owner_id" DROP NOT NULL;
3 changes: 2 additions & 1 deletion db/migrations-goose-postgres/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:COytVKE9Buz/8OC7tm2bghcFpObe1GlNfiWiRYMvSRU=
h1:t6tetdBYweW2ilZiEOnOIhPlaO6ZQRR7OmZuCnKkcOU=
20241211231032_init.sql h1:Cj6GduEDECy6Y+8DfI6767WosqG2AKWybIyJJ6AgKqA=
20241212223714_consistent_naming.sql h1:RvnNmsStlHkmAdSCnX1fFh/KYgfj1RMYYEc4iCN9JcQ=
20250109002850_billing_address.sql h1:m0ek3WXqRgS3+ZbSa/DcIMB16vb8Tjm2MgNqyRll3rU=
Expand All @@ -9,3 +9,4 @@ h1:COytVKE9Buz/8OC7tm2bghcFpObe1GlNfiWiRYMvSRU=
20250115183331_managed_groups.sql h1:AdVu5549xOolPlU5zUuy1JdR1TTHr/uSI2xv1LvFZZs=
20250116051102_membership_edges.sql h1:uQTmqRX56YTDxMZ4w681orLrnLlCC5XIreJIOsrgLeE=
20250119212750_display_id.sql h1:DCYY1M7qdXXGm7ACmIFK00vjAw5ULv6JoqW0TpN7xzM=
20250119225110_task_owner.sql h1:XY1NnJeMn5J76jQoYe8H3s9kCt+73A48xE1MeJirrzI=
4 changes: 4 additions & 0 deletions db/migrations/20250119225108_task_owner.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Modify "task_history" table
ALTER TABLE "task_history" ALTER COLUMN "owner_id" SET NOT NULL;
-- Modify "tasks" table
ALTER TABLE "tasks" DROP CONSTRAINT "tasks_organizations_tasks", ALTER COLUMN "owner_id" SET NOT NULL, ADD CONSTRAINT "tasks_organizations_tasks" FOREIGN KEY ("owner_id") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION;
3 changes: 2 additions & 1 deletion db/migrations/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:ogt+4oiOlhQl/uN6YeaJmAvXQZ2u38KElEogDJrJjC8=
h1:evlhRvzTxt0jMRBS6jAXtZSXJmzPWmDtJVk24sdPUcw=
20241211231032_init.sql h1:TxjpHzKPB/5L2i7V2JfO1y+Cep/AyQN5wGjhY7saCeE=
20241212223712_consistent_naming.sql h1:tbdYOtixhW66Jmvy3aCm+X6neI/SRVvItKM0Bdn26TA=
20250109002849_billing_address.sql h1:mspCGbJ6HVmx3r4j+d/WvruzirJdJ8u5x18WF9R9ESE=
Expand All @@ -9,3 +9,4 @@ h1:ogt+4oiOlhQl/uN6YeaJmAvXQZ2u38KElEogDJrJjC8=
20250115183329_managed_groups.sql h1:s4C9GaUPkPMSIYXR3bVqBDGAd2jrjKFyzwh9IfvO7y8=
20250116051100_membership_edges.sql h1:neajKhc8HN2F88ErsQgroNy6Zvjukgg8nOhWF65xQSM=
20250119212748_display_id.sql h1:7m1bn3r8NL1Pwu0q9Vg9HLQUYwCAVgJocyRBOxgHS8w=
20250119225108_task_owner.sql h1:rNcuoG1FyMgc1QqXD4jiFYRmygOKPCFZsrka40kr+1U=
6 changes: 3 additions & 3 deletions internal/ent/generated/auditing.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions internal/ent/generated/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 35 additions & 35 deletions internal/ent/generated/entql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions internal/ent/generated/gql_collection.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6249acd

Please sign in to comment.