This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Slack app_uninstalled callback event (#331)
- Loading branch information
Showing
12 changed files
with
407 additions
and
152 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
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
33 changes: 33 additions & 0 deletions
33
migrations/versions/20201001_18-36-02__remove_user_token_column.py
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 @@ | ||
"""remove user token column | ||
Revision ID: 1fe0aa535040 | ||
Revises: e51108c88034 | ||
Create Date: 2020-10-01 18:36:02.685882 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "1fe0aa535040" | ||
down_revision = "e51108c88034" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("slack_installation", "access_token") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column( | ||
"slack_installation", | ||
sa.Column( | ||
"access_token", postgresql.BYTEA(), autoincrement=False, nullable=True | ||
), | ||
) | ||
# ### end Alembic commands ### |
150 changes: 150 additions & 0 deletions
150
migrations/versions/20201001_19-05-34__add_cascade_delete_to_foreign_key_.py
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,150 @@ | ||
"""add cascade delete to foreign key relationships | ||
Revision ID: b99005e9733d | ||
Revises: 1fe0aa535040 | ||
Create Date: 2020-10-01 19:05:34.770544 | ||
""" | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b99005e9733d" | ||
down_revision = "1fe0aa535040" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint( | ||
"fk_installation_id", "call_for_proposals_configuration", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"call_for_proposals_configuration", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.drop_constraint( | ||
"fk_installation_id", "github_summary_configuration", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"github_summary_configuration", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.drop_constraint( | ||
"fk_github_summary_configuration_id", "github_summary_user", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_github_summary_configuration_id", | ||
"github_summary_user", | ||
"github_summary_configuration", | ||
["config_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.drop_constraint("fk_installation_id", "slack_user", type_="foreignkey") | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"slack_user", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.drop_constraint( | ||
"fk_installation_id", "upcoming_events_configuration", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"upcoming_events_configuration", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
op.drop_constraint( | ||
"fk_upcoming_events_configuration_id", | ||
"upcoming_events_group", | ||
type_="foreignkey", | ||
) | ||
op.create_foreign_key( | ||
"fk_upcoming_events_configuration_id", | ||
"upcoming_events_group", | ||
"upcoming_events_configuration", | ||
["config_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint( | ||
"fk_upcoming_events_configuration_id", | ||
"upcoming_events_group", | ||
type_="foreignkey", | ||
) | ||
op.create_foreign_key( | ||
"fk_upcoming_events_configuration_id", | ||
"upcoming_events_group", | ||
"upcoming_events_configuration", | ||
["config_id"], | ||
["id"], | ||
) | ||
op.drop_constraint( | ||
"fk_installation_id", "upcoming_events_configuration", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"upcoming_events_configuration", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
) | ||
op.drop_constraint("fk_installation_id", "slack_user", type_="foreignkey") | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"slack_user", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
) | ||
op.drop_constraint( | ||
"fk_github_summary_configuration_id", "github_summary_user", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_github_summary_configuration_id", | ||
"github_summary_user", | ||
"github_summary_configuration", | ||
["config_id"], | ||
["id"], | ||
) | ||
op.drop_constraint( | ||
"fk_installation_id", "github_summary_configuration", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"github_summary_configuration", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
) | ||
op.drop_constraint( | ||
"fk_installation_id", "call_for_proposals_configuration", type_="foreignkey" | ||
) | ||
op.create_foreign_key( | ||
"fk_installation_id", | ||
"call_for_proposals_configuration", | ||
"slack_installation", | ||
["installation_id"], | ||
["id"], | ||
) | ||
# ### end Alembic commands ### |
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
Oops, something went wrong.