mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Move the config database schema version out of the configuration file and into the model class.
Turns out using the config file isn't a good idea if users copy config.py to config_local.py, as it prevents upgrades to the database. This has the added side-effect of simplifying future changes, as you only need to edit 2 files to modify the config DB now, not 3.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
If any of the models are updated, you (yes, you, the developer) MUST do two
|
||||
things:
|
||||
|
||||
1) Increment SETTINGS_SCHEMA_VERSION in config.py
|
||||
1) Increment SCHEMA_VERSION below
|
||||
|
||||
2) Modify setup.py to ensure that the appropriate changes are made to the
|
||||
config database to upgrade it to the new version.
|
||||
@@ -21,6 +21,22 @@ things:
|
||||
from flask.ext.security import UserMixin, RoleMixin
|
||||
from flask.ext.sqlalchemy import SQLAlchemy
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# The schema version is used to track when upgrades are needed to the
|
||||
# configuration database. Increment this whenever changes are made to the
|
||||
# model or data, AND ensure the upgrade code is added to setup.py
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
SCHEMA_VERSION = 13
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# And now we return to our regularly scheduled programming:
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
# Define models
|
||||
|
||||
Reference in New Issue
Block a user