We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I generated a new whitelist via the command line utility, created a new destination database 'snapshot', and executed using the following script:
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) require 'data-anonymization' DataAnon::Utils::Logging.logger.level = Logger::INFO database 'Example' do strategy DataAnon::Strategy::Whitelist source_db ActiveRecord::Base.configurations['development'] destination_db ActiveRecord::Base.configurations['snapshot'] table 'answers' do primary_key 'id' whitelist 'question_id' whitelist 'name' whitelist 'position' whitelist 'value' whitelist 'created_at' whitelist 'updated_at' end end
This failed, since there were no tables in the source database. I copied the table structure, and re-ran the script.
This succeeded the first time, but fails the second time, with duplicate ID errors:
Mysql2::Error: Duplicate entry '3355' for key 'PRIMARY': INSERT INTO `answers` (`created_at`, `id`, `name`, `position`, `question_id`, `updated_at`, `value`) VALUES ('2012-10-04 17:35:03', 3355, NULL, NULL, NULL, '2012-10-04 17:35:03', NULL)
Is there some way to have clear the destination database before each run?
The text was updated successfully, but these errors were encountered:
Best way is to take the dump of the empty destination database and keep restoring it at the beginning of the script. example line # 1
Apologies for year late reply. I missed your message, really sorry. Might be helpful for others.
Sorry, something went wrong.
Yes, for Whitelist Destination tables have to be created.
No branches or pull requests
I generated a new whitelist via the command line utility, created a new destination database 'snapshot', and executed using the following script:
This failed, since there were no tables in the source database. I copied the table structure, and re-ran the script.
This succeeded the first time, but fails the second time, with duplicate ID errors:
Is there some way to have clear the destination database before each run?
The text was updated successfully, but these errors were encountered: