Skip to content

Commit b6e9ad8

Browse files
committed
Add information about using different schema for migration
1 parent 35106f1 commit b6e9ad8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Options:
122122
-ssl-key string
123123
file path to SSL key in pem format (only support on mysql)
124124
-table string
125-
migrations table name (default "goose_db_version")
125+
migrations table name (default "goose_db_version"). If you use a schema that is not `public`, you should set `schemaname.goose_db-version` when running commands.
126126
-timeout duration
127127
maximum allowed duration for queries to run; e.g., 1h13m
128128
-v enable verbose mode
@@ -300,6 +300,9 @@ Both Up and Down migrations within this file will be run without transactions.
300300
By default, SQL statements are delimited by semicolons - in fact, query statements must end with a
301301
semicolon to be properly recognized by goose.
302302

303+
By default, all migrations are run on the public schema. If you want to use a different schema,
304+
specify the schema name using the table option like `-table='schemaname.goose_db_version`.
305+
303306
More complex statements (PL/pgSQL) that have semicolons within them must be annotated with `--
304307
+goose StatementBegin` and `-- +goose StatementEnd` to be properly recognized. For example:
305308

0 commit comments

Comments
 (0)