-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(grouping): make id bigint sequence (#924)
Co-authored-by: Zachary Collins <zachary.collins@sentry.io>
- Loading branch information
1 parent
507ed7c
commit 9d107a9
Showing
8 changed files
with
111 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: false | ||
patch: | ||
default: false | ||
grouping: | ||
paths: | ||
- 'src/seer/grouping/' | ||
automation: | ||
paths: | ||
- 'src/seer/automation/' | ||
severity: | ||
paths: | ||
- 'src/seer/severity/' | ||
trend_detection: | ||
paths: | ||
- 'src/seer/trend_detection/' | ||
app: | ||
paths: | ||
- 'src/seer/app.py' | ||
comment: false | ||
comment: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Migration | ||
Revision ID: 95b4ba4f731d | ||
Revises: 2597db647e9a | ||
Create Date: 2024-07-17 23:35:18.871569 | ||
""" | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "95b4ba4f731d" | ||
down_revision = "2597db647e9a" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute("ALTER TABLE grouping_records ALTER COLUMN id TYPE BIGINT") | ||
op.execute("CREATE SEQUENCE IF NOT EXISTS grouping_records_id_seq") | ||
op.execute( | ||
"ALTER TABLE grouping_records ALTER COLUMN id SET DEFAULT nextval('grouping_records_id_seq')" | ||
) | ||
op.execute("ALTER SEQUENCE grouping_records_id_seq OWNED BY grouping_records.id") | ||
op.execute( | ||
"SELECT setval('grouping_records_id_seq', COALESCE((SELECT MAX(id) FROM grouping_records), 1), true)" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute("ALTER TABLE grouping_records ALTER COLUMN id DROP DEFAULT") | ||
op.execute("DROP SEQUENCE grouping_records_id_seq") | ||
op.execute("ALTER TABLE grouping_records ALTER COLUMN id TYPE INTEGER") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters