capistrano-db-tasks icon indicating copy to clipboard operation
capistrano-db-tasks copied to clipboard

db_ignore_data_tables seem not to impact the dump

Open andreydeineko opened this issue 9 years ago • 6 comments

I tried using the db_ignore_data_tables option as follows (in config/deploy.rb):

set :db_ignore_data_tables, [:versions]

But it still downloads the whole versions table with data.

Where am I wrong? Stack: Rails 4.2.4, capistrano 3.0.0, capistrano-db-tasks 0.4.

andreydeineko avatar Nov 02 '15 11:11 andreydeineko

Do you use mysql or postgresql?

numbata avatar Nov 02 '15 12:11 numbata

@numbata I am using MySQL

andreydeineko avatar Nov 02 '15 12:11 andreydeineko

@andreydeineko unfortunately, this option works only with postgresql now. https://github.com/sgruhier/capistrano-db-tasks/blob/master/lib/capistrano-db-tasks/database.rb#L97

numbata avatar Nov 02 '15 13:11 numbata

@numbata This is really unfortunate. Thanks for info!

Is it because making it available for MySQL is a problem or there is another reason this option does not work with MySQL?

andreydeineko avatar Nov 02 '15 13:11 andreydeineko

@andreydeineko it is impossible for MySQL to do this in one dump command (like in PostgreSQL). we should do something like: mysqldump --ignore-table=db_name.table_name db_name && mysqldump --no-data db_name table_name. I don't know how to do this with current cap-db-tasks code easily.

numbata avatar Nov 02 '15 14:11 numbata

Looks like this was fixed on 9e8e760afe2ee377b6be9ba1d4da90930f958253, the problem must be that you're using version 0.4 of capistrano-db-tasks.

But that's the latest version, @sgruhier would it be a good idea to publish 0.5 ?

UPDATE: Sorry, the commit I mentioned doesn't affect db_ignore_data_tables but db_ignore_tables. So this isn't fixed on master either.

Jesus avatar May 27 '16 06:05 Jesus