From d6949928dc0904ed6072ced5ef68d093b737cfdd Mon Sep 17 00:00:00 2001 From: kristijorgji Date: Thu, 22 Oct 2020 23:39:55 +0200 Subject: [PATCH] update example to use goseeder v1.0.1 --- README.md | 6 ++++-- examples/simpleshop/go.mod | 2 +- examples/simpleshop/go.sum | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3eddb6d..905ea68 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/examples/simpleshop/go.mod b/examples/simpleshop/go.mod index 57d38a9..98c8b4c 100644 --- a/examples/simpleshop/go.mod +++ b/examples/simpleshop/go.mod @@ -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 ) diff --git a/examples/simpleshop/go.sum b/examples/simpleshop/go.sum index 0640432..423d115 100644 --- a/examples/simpleshop/go.sum +++ b/examples/simpleshop/go.sum @@ -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=