(ctx context.Context, id string, opts *database.UpdateProjectOptions)
| 500 | } |
| 501 | |
| 502 | func (c *connection) UpdateProject(ctx context.Context, id string, opts *database.UpdateProjectOptions) (*database.Project, error) { |
| 503 | if err := database.Validate(opts); err != nil { |
| 504 | return nil, err |
| 505 | } |
| 506 | if opts.Annotations == nil { |
| 507 | opts.Annotations = make(map[string]string, 0) |
| 508 | } |
| 509 | |
| 510 | res := &projectDTO{} |
| 511 | err := c.getDB(ctx).QueryRowxContext( |
| 512 | ctx, |
| 513 | ` |
| 514 | UPDATE projects |
| 515 | SET |
| 516 | name = $1, |
| 517 | description = $2, |
| 518 | public = $3, |
| 519 | directory_name = $4, |
| 520 | primary_branch = $5, |
| 521 | git_remote = $6, |
| 522 | github_installation_id = $7, |
| 523 | github_repo_id = $8, |
| 524 | managed_git_repo_id = $9, |
| 525 | archive_asset_id = $10, |
| 526 | primary_deployment_id = $11, |
| 527 | provisioner = $12, |
| 528 | prod_slots = $13, |
| 529 | subpath = $14, |
| 530 | prod_ttl_seconds = $15, |
| 531 | annotations = $16, |
| 532 | prod_version = $17, |
| 533 | dev_slots = $18, |
| 534 | dev_ttl_seconds = $19, |
| 535 | override_disk_gb = $20, |
| 536 | updated_on = now() |
| 537 | WHERE id = $21 |
| 538 | RETURNING * |
| 539 | `, |
| 540 | opts.Name, |
| 541 | opts.Description, |
| 542 | opts.Public, |
| 543 | opts.DirectoryName, |
| 544 | opts.PrimaryBranch, |
| 545 | opts.GitRemote, |
| 546 | opts.GithubInstallationID, |
| 547 | opts.GithubRepoID, |
| 548 | opts.ManagedGitRepoID, |
| 549 | opts.ArchiveAssetID, |
| 550 | opts.PrimaryDeploymentID, |
| 551 | opts.Provisioner, |
| 552 | opts.ProdSlots, |
| 553 | opts.Subpath, |
| 554 | opts.ProdTTLSeconds, |
| 555 | opts.Annotations, |
| 556 | opts.ProdVersion, |
| 557 | opts.DevSlots, |
| 558 | opts.DevTTLSeconds, |
| 559 | opts.OverrideDiskGB, |
nothing calls this directly
no test coverage detected