()
| 832 | os.chmod(config.SQLITE_PATH, 0o600) |
| 833 | |
| 834 | def run_migration_for_others(): |
| 835 | with app.app_context(): |
| 836 | version = Version.query.filter_by(name='ConfigDB').first() |
| 837 | if version == -1: |
| 838 | db_upgrade(app) |
| 839 | else: |
| 840 | schema_version = version.value |
| 841 | |
| 842 | # Run migration if current schema version is greater than the |
| 843 | # schema version stored in version table |
| 844 | if CURRENT_SCHEMA_VERSION >= schema_version: |
| 845 | db_upgrade(app) |
| 846 | |
| 847 | # Update schema version to the latest |
| 848 | if CURRENT_SCHEMA_VERSION > schema_version: |
| 849 | version = Version.query.filter_by(name='ConfigDB').first() |
| 850 | version.value = CURRENT_SCHEMA_VERSION |
| 851 | db.session.commit() |
| 852 | |
| 853 | # Run the migration as per specified by the user. |
| 854 | if config.CONFIG_DATABASE_URI is not None and \ |
no test coverage detected