@runDB - Execute Database Migrations
The @runDB directive in Ahmed PHP Template Engine allows you to execute all .sql migration files in the db directory automatically.
Syntax
@runDB()Description
This directive finds all
.sqlfiles inside thedbfolder and runs them sequentially.Useful for applying database migrations without manually executing SQL commands.
Example
@runDB()Expected Behavior
All SQL files in the
dbfolder are executed in order.If a file fails, execution may stop, depending on the database settings.
Typically used at the beginning of an application to ensure the database is up to date.
Notes
Make sure the
dbfolder contains valid.sqlfiles.Ensure proper database permissions for execution.
Can be used in combination with other database-related directives in Ahmed PHP Template Engine.
Last updated