Skip to content

Commit

Permalink
update example to use goseeder v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kristijorgji committed Oct 23, 2020
1 parent aeee2c0 commit d694992
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,15 @@ and it will run all your seeds against the provided db connection.

The framework will look for `categories.json` file in the path `db/seeds/data`, and insert all the entries there in a table named `categories` (inferred from the file name)

If you have a seed registered for another environment, for example a test seed, the framework instead will look for the json file at `db/seeds/test/data`
If you have a seed registered for another environment, for example a test seed, the framework instead will look for the json file at `db/seeds/data/test`

So the rule is it will always lookup in this pattern `db/seeds/data/[environment]/[specifiedFileName].[type]`

### 3. Run Seeds Only For Specific Env

Many times we want to have seeds only for `test` environment, test purpose and want to avoid having thousand of randomly generated rows inserted into production database by mistake!

Or we just want granular control, to have separate data to populate our app/web in different way for `staging` `prod` `yourcustomenv` and so on.
Or we just want to have granular control, to have separate data to populate our app/web in different way for `staging` `prod` `yourcustomenv` and so on.

goseeder is designed to take care of this by using one of the following methods:

Expand Down
2 changes: 1 addition & 1 deletion examples/simpleshop/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ require (
github.com/go-sql-driver/mysql v1.5.0
github.com/google/uuid v1.1.2
github.com/joho/godotenv v1.3.0
github.com/kristijorgji/goseeder v1.0.0
github.com/kristijorgji/goseeder v1.0.1
)
4 changes: 2 additions & 2 deletions examples/simpleshop/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/kristijorgji/goseeder v1.0.0 h1:u9Ds+xCuBiD269w2M4BtD8/yR3d4hMXRQrm6A4Jien4=
github.com/kristijorgji/goseeder v1.0.0/go.mod h1:G8kIXQODvaUXQ+EL+3oE+OqtEx1L1D39ZSHUzqKQ/MU=
github.com/kristijorgji/goseeder v1.0.1 h1:62ZuIbeltApSbzlWXl9W5/mhtAu+TbNsDerJUeCBZG0=
github.com/kristijorgji/goseeder v1.0.1/go.mod h1:G8kIXQODvaUXQ+EL+3oE+OqtEx1L1D39ZSHUzqKQ/MU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down

0 comments on commit d694992

Please sign in to comment.