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 theusers
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
-
Add the following to your
.env
file:AUTO_MIGRATE=true