Skip to content

Commit

Permalink
OP-12962-OES3.10 analytics drop constraints changes to fix delete app…
Browse files Browse the repository at this point in the history
…lication (#275)
  • Loading branch information
srikanthopsmx authored Mar 9, 2022
1 parent 4c7404c commit 336fd76
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/oes-data-migration-scripts/migration_v3.9.x_to_v3.10.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def perform_migration():
print("Altered column verification_type value of table userservicetemplate in opsmdb")
print("Alter autopilot db table entropy")
updatescript()
print("Alter autopilot db table servicegate and serviceriskanalysis in opsmx db")
updateautopilotconstraints()
modifyGit(hosturl)
print("Modified config data of Datasource type 'GIT'")
modifygitname()
Expand Down Expand Up @@ -333,6 +335,16 @@ def modifyOpsmxdb():
print("Exception occurred while fetching userservicetemplate data : ", e)
raise e

def updateautopilotconstraints():
try:
cur = opsmxdb_conn.cursor()
cur.execute(" ALTER TABLE serviceriskanalysis DROP CONSTRAINT IF EXISTS fkmef9blhpcxhcj431kcu52nm1e ")
print("Successfully dropped constraint serviceriskanalysis table in autopilot db")
cur.execute(" ALTER TABLE servicegate DROP CONSTRAINT IF EXISTS uk_lk3buh56ebai2gycw560j2oxm ")
print("Successfully dropped constraint servicegate table in autopilot db")
except Exception as e:
print("Exception occured while updating script : ", e)
raise e

def updatescript():
try:
Expand Down

0 comments on commit 336fd76

Please sign in to comment.