The Virtual Brain Project

Table Of Contents

Previous topic

model Package

Next topic

simulator Package

This Page

db_update_scripts Package

Define DB changes for each release.

EXAMPLE FILE:

from sqlalchemy import Column, String from migrate.changeset.schema import create_column, drop_column from tvb.core.entities import model

COL_1 = Column(‘orientations_path’, String) COL_2 = Column(‘areas_path’, String)

COL_3 = Column(“local_connectivity_path”, String)

COL_4 = Column(“uid”, String) meta = model.Base.metadata

def upgrade(migrate_engine):

” Upgrade operations go here. Don’t create your own engine; bind migrate_engine to your metadata. ” meta.bind = migrate_engine table1 = meta.tables[‘DATA_connectivity’] create_column(COL_1, table1) create_column(COL_2, table1)

table2 = meta.tables[‘DATA_measuredcortex’] create_column(COL_3, table2)

table3 = meta.tables[‘DATA_TYPES’] create_column(COL_4, table3)

def downgrade(migrate_engine):
” Operations to reverse the above upgrade go here. ” meta.bind = migrate_engine table1 = meta.tables[‘DATA_connectivity’] table2 = meta.tables[‘DATA_measuredcortex’] drop_column(COL_1, table1) drop_column(COL_2, table1) drop_column(COL_3, table2)

001_update_db

Change of DB structure from TVB version 1.0 to TVB 1.0.1.

tvb.core.entities.model.db_update_scripts.001_update_db.downgrade(_migrate_engine)[source]

We do not support downgrade

tvb.core.entities.model.db_update_scripts.001_update_db.upgrade(_migrate_engine)[source]

Change SimulatorAdapter module

002_update_db

003_update_db

Change of DB structure to TVB 1.0.3.

tvb.core.entities.model.db_update_scripts.003_update_db.downgrade(migrate_engine)[source]

Operations to reverse the above upgrade go in this function.

tvb.core.entities.model.db_update_scripts.003_update_db.upgrade(migrate_engine)[source]

Upgrade operations go here. Don’t create your own engine; bind migrate_engine to your metadata.

004_update_db

005_update_db

Change of DB structure for TVB version 1.0.6.

tvb.core.entities.model.db_update_scripts.005_update_db.downgrade(_migrate_engine)[source]

We do not support downgrade

tvb.core.entities.model.db_update_scripts.005_update_db.upgrade(_migrate_engine)[source]

Upgrade operations go here. Don’t create your own engine; bind migrate_engine to your metadata.

006_update_db

Change of DB structure from TVB version 1.0.6 to 1.0.8

tvb.core.entities.model.db_update_scripts.006_update_db.downgrade(_migrate_engine)[source]

Operations to reverse the above upgrade go here.

tvb.core.entities.model.db_update_scripts.006_update_db.upgrade(_migrate_engine)[source]

Upgrade operations go here. Don’t create your own engine; bind migrate_engine to your metadata.

007_update_db

008_update_db

009_update_db

010_update_db

011_update_db

012_update_db

013_update_db

014_update_db

015_update_db

016_update_db

Change of DB structure from TVB version 1.4.1 to TVB 1.4.1b

tvb.core.entities.model.db_update_scripts.016_update_db.downgrade(_)[source]

Downgrade currently not supported

tvb.core.entities.model.db_update_scripts.016_update_db.upgrade(_migrate_engine)[source]

Upgrade operations go here. Don’t create your own engine; bind migrate_engine to your metadata.

017_update_db

018_update_db

Change of DB structure to TVB 2.0

tvb.core.entities.model.db_update_scripts.018_update_db.downgrade(_)[source]

Downgrade currently not supported

tvb.core.entities.model.db_update_scripts.018_update_db.upgrade(migrate_engine)[source]

helper

This modules holds helping function for DB update scripts

tvb.core.entities.model.db_update_scripts.helper.change_algorithm(module, classname, new_module, new_class)[source]

Change module and classname fields in ALGORITHM_GROUPS table.