6

我在任何地方都找不到如何使用“--exclude”。当我尝试这段代码时

heroku help db:pull

我明白了:

Usage: heroku db:pull [DATABASE_URL]

 pull heroku data down into your local database

 DATABASE_URL should reference your local database. if not specified, it
 will be guessed from config/database.yml

 -c, --chunksize SIZE # specify the number of rows to send in each batch
 -d, --debug          # enable debugging output
 -e, --exclude TABLES # exclude the specified tables from the pull
 -f, --filter REGEX   # only pull certain tables
 -r, --resume FILE    # resume transfer described by a .dat file
 -t, --tables TABLES  # only pull the specified tables

好的,我了解如何在一张桌子上使用“-e”,但我想排除一张以上的桌子。它不工作:

heroku db:pull -e users, versions
4

3 回答 3

6

这个对我有用

heroku db:pull -e "stats admins" --app APP_NAME
于 2012-12-10T08:40:55.300 回答
6

来自文档“使用';' 拆分名字”

heroku pg:pull [DATABASE] --exclude-table-data "[FIRST_TABLE_NAME];[SECOND_TABLE_NAME]" --app [APP_NAME]

于 2018-03-12T22:33:22.850 回答
0

我刚用

heroku pg:pull DATABASE_URL LOCAL_DB --exclude-table-data TABLE_NAME --app APP_NAME

更新:要排除多个表尝试

heroku pg:pull DATABASE_URL LOCAL_DB --exclude-table-data TABLE_1_NAME; --exclude-table-data TABLE_2_NAME --app APP_NAME

尝试 heroku pg:pull --help 以获得完整的文档

于 2018-01-26T16:24:13.060 回答