haproxy-wi/app/modules/db/migrations
Aidaho dccc2b3e20 v8.2.3: Add backend header hiding option and improve UDP listener updates
- Introduced `hide_backend_headers` option in Nginx configuration for enhanced security.
- Updated models, templates, and JavaScript to support `hide_backend_headers`.
- Improved UDP listener rendering logic by dynamically fetching and syncing listeners via AJAX.
- Added new database migration to update version to `8.2.3`.
2025-08-26 09:24:20 +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
v8_2_2_update_version.py v8.2.2: Add security headers and HTTP/2 support for Nginx configuration in models, templates, and JS 2025-07-28 11:57:22 +03:00
v8_2_3_update_version.py v8.2.3: Add backend header hiding option and improve UDP listener updates 2025-08-26 09:24:20 +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.