The Virtual Brain Project

Table Of Contents

Previous topic

model Package

Next topic

storage 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

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

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

Operations to reverse the above upgrade go here.

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

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

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

Change of DB structure after TVB 1.0.4, and before 1.0.5

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

Operations to reverse the above upgrade go here.

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

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

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

Change of DB structure from TVB version 1.0.8 to 1.1.

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

Operations to reverse the above upgrade go here.

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

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

008_update_db

Change of DB structure from TVB version 1.1 to pre 1.1.1

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

Operations to reverse the above upgrade go here.

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

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

009_update_db

Change of DB structure to TVB version 1.1.1

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

Operations to reverse the above upgrade go here.

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

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

010_update_db

Change of DB structure from TVB version 1.1.2 to 1.1.3

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

Operations to reverse the above upgrade go here.

tvb.core.entities.model.db_update_scripts.010_update_db.remove_visualizer_references()[source]

As we removed an algorithm, remove left-overs.

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

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

011_update_db

Change of DB structure from TVB version 1.2 to 1.2.1

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

Operations to reverse the above upgrade go here.

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

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

012_update_db

Change of DB structure from TVB version 1.2.1 to 1.2.2

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

Operations to reverse the above upgrade go here.

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

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

013_update_db

Change of DB structure from TVB version 1.2.2 to 1.2.3

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

Operations to reverse the above upgrade go here.

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

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

014_update_db

Change of DB structure from TVB version 1.3 to 1.3.1

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

Operations to reverse the above upgrade go here.

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

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

015_update_db

Change of DB structure from TVB version 1.3.1 to 1.4

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

Operations to reverse the above upgrade go here.

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

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

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

Change of DB structure from TVB version 1.4.1 to TVB 1.5

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

Downgrade currently not supported

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

Alter existing table ALGORITHMS, by moving columns from the old ALGORITHM_GROUPS table.

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.