Manual:SqliteMaintenance.php
MediaWiki version: | ≥ 1.36 |
MediaWiki file: SqliteMaintenance.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.43.0 • 1.42.4 • 1.39.11 |
Classes: | SqliteMaintenance |
Details
editSqliteMaintenance.php file is a maintenance script that performs some operations specific to SQLite database backend.
Options/Arguments
editOption | 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
editphp maintenance/run.php SqliteMaintenance [ --vacuum| --integrity| --backup-to| --check-syntax ]
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.Checking integrity
editTerminal
$ php maintenance/run.php SqliteMaintenance --integrity Performing database integrity checks: ok
Vacuum Operation
editTerminal
$ php maintenance/run.php SqliteMaintenance --vacuum VACUUM: Database size was 46995456 bytes, now 37796864 (19.6% reduction).
Checking SQL file syntax
editpatch-actor-table.sql
--
-- patch-actor-table.sql
--
-- T167246. Add an `actor` table.
CREATE TABLE /*_*/actor (
actor_id bigint unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
actor_user int unsigned,
actor_name varchar(255) binary NOT NULL
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/actor_user ON /*_*/actor (actor_user);
CREATE UNIQUE INDEX /*i*/actor_name ON /*_*/actor (actor_name);
Terminal
$ php maintenance/run.php SqliteMaintenance --check-syntax patch-actor-table.sql SQL syntax check: no errors detected.