Commands
In the project's root directory you can run console commands like this:
php bin/console db-journal {action} [--option1=value] [--option2=value]
This will run a PHP script where {action}
can be any of these commands:
Action | Description | Options |
---|---|---|
setup | Create the internal table required to run the journal | - |
init | Output the journal queries for the given filters | time |
update | Ensure that every table journal will be updated to the current database timestamp (this should be the command called through a cron job) | time |
dump | Output the journal queries filtering by the given options | table mintime maxtime |
run | [WARNING] Apply the given Journal to the current database | table mintime maxtime |
list | List the available DbJournal commands | - |
schema | Dump the database structure like['Table' => ['column1' => $column1Object, 'column2' => $column2Object, ...], ...] |
- |
time | Show the current database time | - |
clean | Clean the existing journal records and files (warning, you won't be able to run pre-existing journals after this) | - |
uninstall | Remove DbJournal table and files | - |
You can also use the following options (always preceded by --
) combined with the above commands:
v
,vv
orvvv
: Verbose level (vvv
being the most verbose) for any commandtime
: set the current time for theinit
orupdate
command (so they'll run with the inputted time)table
: restrict thedump
orrun
command to a single tablemintime
|gt
: use it with thedump
command to restrict the dump to operations that happened after that timestamp (format YYYY-mm-dd)maxtime
|lt
: use it with thedump
command to restrict the dump to operations that happened before that timestamp (format YYYY-mm-dd)