Skip to content
New issue

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

Table 'fake_user' already exists #8

Open
apandichi opened this issue May 23, 2018 · 1 comment
Open

Table 'fake_user' already exists #8

apandichi opened this issue May 23, 2018 · 1 comment

Comments

@apandichi
Copy link

apandichi commented May 23, 2018

I get this error sometimes, because another error (caused by a typo in a table name in my JSON config file) can happen between insert_fake_data and remove_fake_data, preventing remove_fake_data from running. In this case, I have to manually drop the "fake_user" table before I can run the anonymizer again.

  def anonymize
    insert_fake_data

    @config['tables'].each do |table_name, columns|
      querys = column_query(table_name, columns)

      querys.each do |query|
        @db.run query
      end
    end

    remove_fake_data
  end

The solution could be to either catch any errors happening between insert_fake_data and remove_fake_data (to allow remove_fake_data to run regardless of errors).
Or to use "create table if exists" when creating the "fake_user" table, to let the anonymizer continue even if the table already exists.

@Warxcell
Copy link

I have the same error, but even after manual DROP error still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants