Manual:SqliteMaintenance.php
Appearance
From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
MediaWiki version:
≥ 1.36
| MediaWiki file: SqliteMaintenance.php | |
|---|---|
| Location: | maintenance/ |
| Source code: | master • 1.45.1 • 1.44.3 • 1.43.6 |
| Classes: | SqliteMaintenance |
Details
SqliteMaintenance.php file is a maintenance script that performs some operations specific to SQLite database backend.
Options/Arguments
| Option | Description | Required? |
|---|---|---|
| --vacuum | Clean up database by removing deleted pages. Decreases database file size | Optional |
| --integrity | Check database for integrity | Optional |
| --backup-to | Backup database to the given file | Optional |
| --check-syntax | Check SQL file(s) for syntax errors | Optional |
Usage
phpmaintenance/run.phpSqliteMaintenance[--vacuum|--integrity|--backup-to|--check-syntax]
In MediaWiki version 1.43.6 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php instead of php maintenance/run.php scriptName.Checking integrity
Terminal
$ php maintenance/run.php SqliteMaintenance --integrity Performing database integrity checks: ok
Vacuum Operation
Terminal
$ php maintenance/run.php SqliteMaintenance --vacuum VACUUM: Database size was 46995456 bytes, now 37796864 (19.6% reduction).
Checking SQL file syntax
patch-actor-table.sql
-- -- patch-actor-table.sql -- -- T167246. Add an `actor` table. CREATETABLE/*_*/actor( actor_idbigintunsignedNOTNULLPRIMARYKEYAUTO_INCREMENT, actor_userintunsigned, actor_namevarchar(255)binaryNOTNULL )/*$wgDBTableOptions*/; CREATEUNIQUEINDEX/*i*/actor_userON/*_*/actor(actor_user); CREATEUNIQUEINDEX/*i*/actor_nameON/*_*/actor(actor_name);
Terminal
$ php maintenance/run.php SqliteMaintenance --check-syntax patch-actor-table.sql SQL syntax check: no errors detected.