Skip to content

fix(appconnect): Add app_id_str column to appconnectbuild - #40261

Merged
loewenheim merged 8 commits into
masterfrom
fix/add-appid-str-migration
Oct 24, 2022
Merged

loewenheim merged 8 commits into
masterfrom
fix/add-appid-str-migration

Conversation

@loewenheim

@loewenheim loewenheim commented Oct 19, 2022 •

Copy link
Copy Markdown
Contributor

This is step 1 in the effort to change the type of AppConnectBuild.app_id from an integer to a string.

It adds a new column app_id_str of type CharField to the appconnectbuild model and a corresponding field to AppConnectBuild.

@loewenheim
loewenheim requested a review from a team as a code owner October 19, 2022 15:40
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 19, 2022
@github-actions

github-actions Bot commented Oct 19, 2022 •

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0325_add_appid_str.py ()

--
-- Custom state/database change combination
--

                    ALTER TABLE "sentry_appconnectbuild" ADD COLUMN "app_id_str" character(256) DEFAULT "0";
                    ;

@wedamija wedamija left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This pr should include the change that adds the field to the model.

I noticed in #40264 that you are setting a default of "0". Since we're on pg14 you can actually create the column with a default if you like. https://develop.sentry.dev/database-migrations/#adding-columns-with-a-default. This also allows you to make the column not null, if that's helpful

@loewenheim

Copy link
Copy Markdown
Contributor Author

Thank you for the feedback. I've now consolidated the two PRs and adjusted the migration to hopefully make it default-safe.

@loewenheim
loewenheim force-pushed the fix/add-appid-str-migration branch from 7f3ed1f to 5187bc3 Compare October 20, 2022 14:49
@github-actions

github-actions Bot commented Oct 20, 2022 •

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0326_add_appid_str.py ()

--
-- Custom state/database change combination
--

                    ALTER TABLE "sentry_appconnectbuild" ADD COLUMN "app_id_str" character(256) NOT NULL DEFAULT '0';
                    ;

Comment thread src/sentry/models/appconnectbuilds.py Resolved
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0327_add_appid_str.py ()

--
-- Custom state/database change combination
--

                    ALTER TABLE "sentry_appconnectbuild" ADD COLUMN "app_id_str" varchar(256) NOT NULL DEFAULT '0';
                    ;

@loewenheim
loewenheim merged commit e38aa13 into master Oct 24, 2022
@loewenheim
loewenheim deleted the fix/add-appid-str-migration branch October 24, 2022 09:23
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 8, 2022

This branch was successfully deployed

2 active deployments
Preview – storybook — 72c329a7 Deployed Oct 21, 2022 by vercel[bot]
Preview – sentry — 72c329a7 Deployed Oct 21, 2022 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants