Manuel:SqliteMaintenance.php
Appearance
Version de MediaWiki : | ≥ 1.36 |
Fichier MediaWiki : SqliteMaintenance.php | |
---|---|
Emplacement : | maintenance/ |
Code source : | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes : | SqliteMaintenance |
Détails
SqliteMaintenance.php file is a maintenance script that performs some operations specific to SQLite database backend.
Options et arguments
Option | Description | Nécessaire ? |
---|---|---|
--vacuum | Clean up database by removing deleted pages. Decreases database file size | optionnel |
--integrity | Check database for integrity | optionnel |
--backup-to | Backup database to the given file | optionnel |
--check-syntax | Check SQL file(s) for syntax errors | optionnel |
Utilisation
php maintenance/SqliteMaintenance.php [ --vacuum| --integrity| --backup-to| --check-syntax ]
Contrôler l'intégrité
Terminal
$ php maintenance/SqliteMaintenance.php --integrity Performing database integrity checks: ok
Vacuum Operation
Terminal
$ php maintenance/SqliteMaintenance.php --vacuum VACUUM: Database size was 46995456 bytes, now 37796864 (19.6% reduction).
Vérifier la syntaxe des fichiers SQL
patch-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/SqliteMaintenance.php --check-syntax patch-actor-table.sql SQL syntax check: no errors detected.