-
Couldn't load subscription status.
- Fork 5
Credentials: Using Hard Delete & Updating is_active logic #360
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
Changes from all commits
f1fbe6c
4f87565
4737f95
f654841
f6212e8
6014fc1
f3f013b
c7ef7e9
c48bf44
ed2380e
c62943b
3c2e598
9f11c8a
04a4810
1007e63
9ced6c6
148ab5d
1ebac46
d62d36b
5b46b66
47fb0db
e041cae
bed21be
4f83260
1134c43
e4d939a
ea279dc
1ce59f8
1e97b17
348f87e
627ebc1
54f9c77
4c10661
59f3a55
f0d3148
aa14727
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||||||||||||||||
| """drop column deleted_at from credentials | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Revision ID: 27c271ab6dd0 | ||||||||||||||||||||
| Revises: 93d484f5798e | ||||||||||||||||||||
| Create Date: 2025-10-15 11:10:02.554097 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| """ | ||||||||||||||||||||
| from alembic import op | ||||||||||||||||||||
| import sqlalchemy as sa | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # revision identifiers, used by Alembic. | ||||||||||||||||||||
| revision = "27c271ab6dd0" | ||||||||||||||||||||
| down_revision = "93d484f5798e" | ||||||||||||||||||||
| branch_labels = None | ||||||||||||||||||||
| depends_on = None | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| def upgrade(): | ||||||||||||||||||||
| # Drop only deleted_at column from credential table, keep is_active for flexibility | ||||||||||||||||||||
| op.drop_column("credential", "deleted_at") | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Add unique constraint on organization_id, project_id, provider | ||||||||||||||||||||
| op.create_unique_constraint( | ||||||||||||||||||||
| "uq_credential_org_project_provider", | ||||||||||||||||||||
| "credential", | ||||||||||||||||||||
| ["organization_id", "project_id", "provider"], | ||||||||||||||||||||
| ) | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| def downgrade(): | ||||||||||||||||||||
| # Add back deleted_at column to credential table | ||||||||||||||||||||
| op.add_column("credential", sa.Column("deleted_at", sa.DateTime(), nullable=True)) | ||||||||||||||||||||
|
Comment on lines
+30
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore The downgrade path should recreate the schema exactly as it existed before this migration. In - op.add_column("credential", sa.Column("deleted_at", sa.DateTime(), nullable=True))
+ op.add_column(
+ "credential",
+ sa.Column("deleted_at", sa.DateTime(timezone=True), nullable=True),
+ )📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| # Drop the unique constraint | ||||||||||||||||||||
| op.drop_constraint( | ||||||||||||||||||||
| "uq_credential_org_project_provider", "credential", type_="unique" | ||||||||||||||||||||
| ) | ||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.