Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"heroku db:pull --exclude table_name" How to exclude more than one table?

I can't find anywhere how to use "--exclude". When I try this code

heroku help db:pull

I get this:

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

ok I understand how to use "-e" with one table, but I want to exclude more than one table. It is not working:

heroku db:pull -e users, versions
like image 849
Furkan Ayhan Avatar asked Dec 10 '12 08:12

Furkan Ayhan


People also ask

How to exclude more than one table from a MySQL database?

mysqldump --no-data db_name > export.sql mysqldump --no-create-info --ignore-table=db_name.table_name db_name >> export.sql if you want to exclude more than 1 table, simply use the --ignore-table directive more often (in the 2nc command) - see mysqldump help: --ignore-table=name Do not dump the specified table.

How do I ignore a specific table in Linux?

--ignore-table=name Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g., --ignore-table=database.table

How do I ignore a table in a MySQL database?

mysqldump --ignore-table=db_name.table_name db_name > export.sql mysqldump --no-data db_name table_name >> export.sql This is a better answer because it skips the unwanted data but gets the wanted schema, and I like that it still makes one file. Note that you can the use --ignore-table option multiple times to ignore multiple tables.


1 Answers

It works for me

heroku db:pull -e "stats admins" --app APP_NAME
like image 56
eyupatis Avatar answered Sep 18 '22 20:09

eyupatis