Skip to content
Browse files

BRANCH 4.0.0.v01_install_fix:

  upgrade script fix to use my.get_database_type() instead
  • Loading branch information...
1 parent 697a9f5 commit 83a0a36e4e61a3e95fd70bfd9c4f2347b04868bb @oboreo oboreo committed Sep 26, 2013
View
5 src/pyasm/search/upgrade/project/base_upgrade.py
@@ -109,6 +109,11 @@ def execute(my):
my.run_method(name, method)
+ def get_database_type(my):
+ project = Project.get_by_code(my.project_code)
+ db_resource = project.get_project_db_resource()
+ db = DbContainer.get(db_resource)
+ return db.get_database_type()
def run_method(my, name, method):
try:
View
6 src/pyasm/search/upgrade/project/sthpw_upgrade.py
@@ -121,7 +121,7 @@ def upgrade_v4_0_0_b01_001(my):
# 4.0.0.a09
#
def upgrade_v4_0_0_a09_002(my):
- if Sql.get_database_type() == 'MySQL':
+ if my.get_database_type() == 'MySQL':
my.run_sql('''ALTER TABLE file MODIFY search_id integer NULL;''')
else:
my.run_sql('''
@@ -302,7 +302,7 @@ def upgrade_v4_0_0_a01_027(my):
def upgrade_v4_0_0_a01_026(my):
- if Sql.get_database_type() == 'MySQL':
+ if my.get_database_type() == 'MySQL':
my.run_sql('''ALTER TABLE snapshot MODIFY column_name varchar(100) NULL;''')
else:
my.run_sql('''ALTER TABLE snapshot ALTER COLUMN column_name DROP NOT NULL;''')
@@ -1621,7 +1621,7 @@ def upgrade_v3_5_0_v01_003(my):
''')
def upgrade_v3_5_0_v01_002(my):
- if Sql.get_database_type() == 'MySQL':
+ if my.get_database_type() == 'MySQL':
my.run_sql('''
ALTER table snapshot modify lock_login varchar(100) NULL;
''')

0 comments on commit 83a0a36

Please sign in to comment.
Something went wrong with that request. Please try again.