Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add migration for release plans #8529

Merged
merged 4 commits into from
Oct 24, 2024
Merged

Conversation

daveleek
Copy link
Contributor

Adds release plans migration.

  • Creates release_plan_definitions
  • Creates milestones
  • Creates milestone_strategies
  • Creates indexes on FK of milestones and milestone_strategies tables

Adds a down migration that removes indexes, columns, and tables in an order that addresses inter-dependencies

Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2024 10:07am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2024 10:07am

Copy link
Contributor

github-actions bot commented Oct 24, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

CREATE INDEX IF NOT EXISTS idx_milestones_release_plan_definition_id ON milestones (release_plan_definition_id);

ALTER TABLE IF EXISTS release_plan_definitions
ADD COLUMN IF NOT EXISTS active_milestone_id SERIAL REFERENCES milestones(id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly this is an INT (you don't want a separate sequence generated here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep 100% correct


CREATE TABLE IF NOT EXISTS milestone_strategies
(
id SERIAL PRIMARY KEY NOT NULL,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a textual id here as well?

CREATE TABLE IF NOT EXISTS milestone_strategies
(
id SERIAL PRIMARY KEY NOT NULL,
milestone_id SERIAL NOT NULL REFERENCES milestones(id) ON DELETE CASCADE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here, the type of the FK side of the relationship isn't another SERIAL, it's an INT.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, I'd suggest maybe having all these new tables have textual PKs

Copy link
Member

@chriswk chriswk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we're making a cyclic dependency between release_plan_definitions and milestones?

Copy link
Member

@chriswk chriswk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. LGTM

@daveleek
Copy link
Contributor Author

So, we're making a cyclic dependency between release_plan_definitions and milestones?

Addressed in chat - But for clarity: yes. It's intentional but shouldn't be cyclic. a release_plan_definition will be added, milestones will be added to this release plan, then we can set an active milestone via the release_plan_definition.active_milestone_id.

@daveleek daveleek merged commit fbd3f97 into main Oct 24, 2024
8 checks passed
@daveleek daveleek deleted the chore/release-plans-migration branch October 24, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants