diff --git a/apiserver/back_migration.py b/apiserver/back_migration.py index c1ccc28b5..0f272755f 100644 --- a/apiserver/back_migration.py +++ b/apiserver/back_migration.py @@ -3,7 +3,15 @@ import uuid import random from django.contrib.auth.hashers import make_password from plane.db.models import ProjectIdentifier -from plane.db.models import Issue, IssueComment, User, Project, ProjectMember, Label +from plane.db.models import ( + Issue, + IssueComment, + User, + Project, + ProjectMember, + Label, + Integration, +) # Update description and description html values for old descriptions @@ -174,3 +182,29 @@ def update_label_color(): except Exception as e: print(e) print("Failed") + + +def create_slack_integration(): + try: + _ = Integration.objects.create(provider="slack", network=2, title="Slack") + print("Success") + except Exception as e: + print(e) + print("Failed") + + +def update_integration_verified(): + try: + integrations = Integration.objects.all() + updated_integrations = [] + for integration in integrations: + integration.verified = True + updated_integrations.append(integration) + + Integration.objects.bulk_update( + updated_integrations, ["verified"], batch_size=10 + ) + print("Sucess") + except Exception as e: + print(e) + print("Failed")