Skip to content

Commit

Permalink
TVB-2132 Add new column on Sim_State DT (from commit #7913)
Browse files Browse the repository at this point in the history
git-svn-id: https://repo.thevirtualbrain.org/svn/tvb/trunk/framework_tvb@8001 1c0e02f0-7929-43c0-8fb3-3293bf43b0d1
  • Loading branch information
liadomide committed Jun 17, 2016
1 parent af04c68 commit 5c046aa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tvb/core/entities/model/db_update_scripts/017_update_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ def upgrade(migrate_engine):
for col in ADD_COLUMNS:
create_column(col, table_algo)

session = SA_SESSIONMAKER()
try:
session.execute(text("ALTER TABLE \"MAPPED_SIMULATION_STATE\" "
"ADD COLUMN _current_state VARYING CHARACTER(255)"))
session.commit()
except Exception, _:
session.close()
session = SA_SESSIONMAKER()
session.execute(text("ALTER TABLE \"MAPPED_SIMULATION_STATE\" "
"ADD COLUMN _current_state character varying;"))
session.commit()
finally:
session.close()

session = SA_SESSIONMAKER()
try:
session.execute(text(
Expand Down

0 comments on commit 5c046aa

Please sign in to comment.