Skip to content

Version 1.0.1 – Automatic Database Migration with Smart Logger

Latest
Compare
Choose a tag to compare
@jandersongarcia jandersongarcia released this 15 Jul 21:40
· 7 commits to main since this release

What's New

  • Added support for automatic database migration via AUTO_MIGRATE=true in the .env file.
  • The migration script automatically runs auth-migrations.sql if the users table does not exist.
  • After a successful migration, the AUTO_MIGRATE flag is automatically set to false in the .env.
  • All operations are logged using LoggerFactory, including failures and inconsistencies.
  • Error logs are sent to Telegram (if configured).

Structure

  • New file: bootstrap/auto_migrate.php
  • The file core/migrations/auth-migrations.sql is expected to contain the initial SQL schema.
  • Table existence is checked using SHOW TABLES LIKE 'users'.

Security

  • No echo or HTML/CLI output is used. All feedback is handled through internal logging.
  • Logs include IP address, user agent, URI, and UID for full traceability.

How to Use

  1. Add the following to your .env file:

    AUTO_MIGRATE=true