-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* some docs and process-mysqldump safer * stuff for v0.2 & docs * fix tests * install docker on build * store process-mysqldump locally * use $GITHUB_TOKEN from travis * only deploy docs on master
- Loading branch information
Harry Bragg
authored
Aug 13, 2018
1 parent
f4e38da
commit 86c65ea
Showing
29 changed files
with
1,055 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/vendor/ | ||
/tests/report/ | ||
/site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"default": true, | ||
"MD013": { | ||
"line_length": 120, | ||
"code_blocks": false, | ||
"tables": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Truncating Data (Chop) | ||
|
||
The chop command has the following structure: | ||
|
||
```bash | ||
sprout chop [--config=<path>] [--group=<group>] [<schema>[:<table>,...]] ... | ||
``` | ||
This will truncate the contents of all the specified tables. | ||
!!! note | ||
By default when you [seed](seed.md) data it will truncate the tables it finds first, so there is no need to do this | ||
manually. | ||
## Configuration file | ||
The optional `--config` option allows you specify the configuration file to use. By default it will look for a file | ||
called `config/sprout.yml`. The location is relative to the working directory. Within docker this is `/app`. | ||
## Schema and Table configuration | ||
All commands make use of the same [Schema and Tables](../schemas_tables.md) parsing. | ||
The `[<schema>[:<table>,...]] ...` part of the command line allows you to specify none or some schemas, each schema with | ||
a set of tables or not. | ||
If no schema is defined, all the schemas and tables that are on the filesystem in a group will be truncated. | ||
If no tables are defined for a schema, all tables on the filesystem will be truncated. | ||
### Chopping all the data | ||
You can truncate all the tables that exist locally if you do not specify and schemas or tables. | ||
```bash | ||
sprout chop | ||
``` | ||
This will truncate all the data in the default group. See [groups](#groups) for more information on how the groups work. | ||
### Truncating all the tables in a schema | ||
```bash | ||
sprout chop schema1 | ||
``` | ||
This will chop (truncate) all the tables that exist on the filesystem in the schema: `schema1`. | ||
You can truncate multiple schemas too: | ||
```bash | ||
sprout chop schema1 schema2 | ||
``` | ||
### Chopping specific tables | ||
If you only want to truncate a set of specific tables you can specify them as a comma separated list | ||
after the schema they apply to. | ||
```bash | ||
sprout chop schema1:table1,table2 | ||
``` | ||
You can also specify multiple schemas, each with their own set of tables | ||
```bash | ||
sprout chop schema1:table1,table2 schema2:table3 | ||
``` | ||
## Groups | ||
The optional `--group` option allows you to specify which group to read the seed data from. If this is not | ||
supplied it will use the default value as defined in the [configuration file](../setup/configuration.md). | ||
See [Chopping individual groups](../groups.md#you-can-truncate-from-a-group-as-well) for more information on how to | ||
truncate data in groups. | ||
You can see all of the data in a group by calling: | ||
```bash | ||
sprout chop --group=testing | ||
``` | ||
Or you can limit it to a set of schemas and tables: | ||
```bash | ||
sprout chop --group=testing schema1 schema2:table1,table2 | ||
``` |
Oops, something went wrong.