haproxy-wi/app/modules/db/migrations
Aidaho 073a86be80 v8.2.1: Refactor HA and Config Compare modules, optimize service installation flow, and add Spanish language support
- Replaced unused AJAX and JS methods (`cleanProvisioningProcess`, `showErrorStatus`) in HA management with simpler, streamlined equivalents. Moved HA cluster data fetching logic to the new endpoint (`HAClustersView`).
- Introduced `compareConfig()` method to improve configuration diff rendering. Removed redundant templates (`compare.html`), leveraging external Diff2Html library.
- Simplified HA service installation logic in `Reconfigure`, enabling task-based tracking. Removed redundant progress logic (`increaseProgressValue`, `checkInstallResp`).
- Added support for Spanish localization (`es-ES.html`, updated `languages.html` template).
- Replaced Python PagerDuty SDK for a more actively maintained library.
- Fixed description rendering logic in HA cluster templates.
- Updated Nginx to support multiple aliases per server.
- Minor dependency updates and comments cleanup in Ansible WAF tasks.
2025-07-03 17:57:53 +03:00
..
20230101000000_initial_migration.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000001_update_user_groups.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000002_add_use_src_to_ha_cluster_vips.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000003_rename_backups_columns.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000004_rename_multiple_columns.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000005_add_shared_to_cred.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000006_delete_prometheus_tools.py v8.2.0: Fix action type in Nginx config update and clean up spacing. 2025-05-17 11:37:01 +03:00
20230101000007_rename_server_to_server_id.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000008_rename_server_to_server_id_in_s3_backups.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000009_rename_rhost_to_rserver.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000010_rename_period_to_time.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000011_rename_group_to_group_id.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000012_add_private_key_to_cred.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000013_add_is_checker_to_udp_balancers.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20230101000014_update_version.py v8.2.0: Fix string interpolation in migration error messages 2025-05-17 11:30:44 +03:00
20252105000014_update_version.py v8.2.0.4: bug fix. add new HAProxy versions 2025-05-24 09:14:19 +03:00
README.md v8.2.0: Add database migration framework and initial migrations 2025-05-17 08:51:50 +03:00
__init__.py v8.2.0: Fix action type in Nginx config update and clean up spacing. 2025-05-17 11:37:01 +03:00
v8_2_1_update_version.py v8.2.1: Refactor HA and Config Compare modules, optimize service installation flow, and add Spanish language support 2025-07-03 17:57:53 +03:00

README.md

Database Migrations

This directory contains database migration files for Roxy-WI. Each migration file represents a specific change to the database schema.

Migration System

The migration system is designed to track which migrations have been applied, apply migrations in the correct order, and support rollbacks. It uses Peewee's migration functionality to make changes to the database schema.

Migration Files

Each migration file is a Python module with two functions:

  • up(): Applies the migration
  • down(): Rolls back the migration

Migration files are named with a timestamp prefix to ensure they are applied in the correct order.

Using the Migration System

The migration system provides a command-line interface for managing migrations. The following commands are available:

Initialize the Migrations Table

python app/migrate.py init

This command creates the migrations table in the database if it doesn't exist.

Create a New Migration

python app/migrate.py create <migration_name>

This command creates a new migration file with the given name. The file will be created in the migrations directory with a timestamp prefix.

Apply Pending Migrations

python app/migrate.py migrate

This command applies all pending migrations in the correct order.

Roll Back Migrations

python app/migrate.py rollback [--steps <number>]

This command rolls back the specified number of migrations (default: 1) in reverse order.

Automatic Migrations

The migration system is automatically run when the application starts up. This ensures that the database schema is always up to date.

Converting from the Old Update System

The old update system used multiple update functions in create_db.py to handle database schema changes. These functions have been converted to migration files in this directory. The application now uses the migration system instead of the old update functions.