mss_dataserver.core.database_util

Utility functions to interact with the database.

copyright

Stefan Mertl

license

GNU General Public License, Version 3 (http://www.gnu.org/licenses/gpl-3.0.html)

Functions

add_column(engine, table, column, prefix)

Add a column to a database table.

add_foreign_key(engine, table, columns, …)

Add a foreign key constraint.

add_foreign_key_old(engine, table, column, …)

Add a foreign key to the column.

add_unique_constraint(engine, table, constraint)

Add a unique constraint to the table.

change_column_type(engine, table, column)

Change the type of a database table column.

compare_column_type(col1, col2)

Compare the type of two columns.

db_table_migration(engine, table, prefix)

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

remove_column(engine, table, column)

Remove a column from the database table.

remove_foreign_key(engine, table, fk_symbol)

Remove a foreign key.

remove_unique_constraint(engine, table, name)

Remove a unique constraint from the table using the constraint name.

update_db_table(engine, table, metadata, prefix)

Update the table structure to the new schema.