【问题标题】:"heroku db:pull --exclude table_name" How to exclude more than one table?"heroku db:pull --exclude table_name" 如何排除多个表?
【发布时间】:2012-11-27 15:23:11
【问题描述】:

我在任何地方都找不到如何使用“--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

【问题讨论】:

  • 如果我必须根据常见的命令行约定做出有根据的猜测,我会说-e "users versions",但这只是几种可能性之一。但是,如果出于任何原因,其中有空格,您肯定需要引号。

标签: database heroku


【解决方案1】:

对我有用

heroku db:pull -e "stats admins" --app APP_NAME

【讨论】:

  • 似乎不再支持此功能?
  • 不再支持,使用--exclude-table-data
  • 弃用标志
【解决方案2】:

我刚用过

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 以获取完整文档

【讨论】:

    【解决方案3】:

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

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

    【讨论】:

      猜你喜欢
      • 2013-10-09
      • 1970-01-01
      • 2013-02-24
      • 1970-01-01
      • 2012-02-12
      • 1970-01-01
      • 1970-01-01
      • 2012-09-16
      • 1970-01-01
      相关资源
      最近更新 更多