mss_dataserver.core.database_util.db_table_migration

mss_dataserver.core.database_util.db_table_migration(engine, table, prefix)[source]

Check if a database table migration is needed and apply the changes.

Check the table definition of the database with the one from defined in the current database factories of the modules. If changes are detected, the database tables are updated to fit the new version.

Parameters
  • engine (sqlalchemy.engine.Engine) – The sqlalchemy database Engine.

  • table (sqlalchemy.schema.Table) – The table to migrate.

  • prefix (String) – The database table name prefix. The names of the tables contain only the basename (e.g. geom_recorder). The full table name usually contains the name of the project as a prefix.