Skip to content

Commit 5a239dc

Browse files
Merge pull request #119 from wp-cli/update-readme
Add new `db clean` to `README.md` and configuration files
2 parents 8ddd33b + 9b23f0c commit 5a239dc

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/settings.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ labels:
2222
color: c2e0c6
2323
- name: command:db
2424
color: c5def5
25+
- name: command:db-clean
26+
color: c5def5
2527
- name: command:db-create
2628
color: c5def5
2729
- name: command:db-drop

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,36 @@ wp db
3838

3939

4040

41+
### wp db clean
42+
43+
Removes all tables with `$table_prefix` from the database.
44+
45+
~~~
46+
wp db clean [--dbuser=<value>] [--dbpass=<value>] [--yes]
47+
~~~
48+
49+
Runs `DROP_TABLE` for each table that has a `$table_prefix` as specified
50+
in wp-config.php.
51+
52+
**OPTIONS**
53+
54+
[--dbuser=<value>]
55+
Username to pass to mysql. Defaults to DB_USER.
56+
57+
[--dbpass=<value>]
58+
Password to pass to mysql. Defaults to DB_PASSWORD.
59+
60+
[--yes]
61+
Answer yes to the confirmation message.
62+
63+
**EXAMPLES**
64+
65+
# Delete all tables that match the current site prefix.
66+
$ wp db clean --yes
67+
Success: Tables dropped.
68+
69+
70+
4171
### wp db create
4272

4373
Creates a new database.
@@ -660,6 +690,15 @@ The size defaults to a human-readable number.
660690
- mb (megabytes)
661691
- gb (gigabytes)
662692
- tb (terabytes)
693+
- B (ISO Byte setting, with no conversion)
694+
- KB (ISO Kilobyte setting, with 1 KB = 1,000 B)
695+
- KiB (ISO Kibibyte setting, with 1 KiB = 1,024 B)
696+
- MB (ISO Megabyte setting, with 1 MB = 1,000 KB)
697+
- MiB (ISO Mebibyte setting, with 1 MiB = 1,024 KiB)
698+
- GB (ISO Gigabyte setting, with 1 GB = 1,000 MB)
699+
- GiB (ISO Gibibyte setting, with 1 GiB = 1,024 MiB)
700+
- TB (ISO Terabyte setting, with 1 TB = 1,000 GB)
701+
- TiB (ISO Tebibyte setting, with 1 TiB = 1,024 GiB)
663702
---
664703

665704
[--tables]

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"bundled": true,
3030
"commands": [
3131
"db",
32+
"db clean",
3233
"db create",
3334
"db drop",
3435
"db reset",

0 commit comments

Comments
 (0)