Skip to content
This repository was archived by the owner on Sep 23, 2024. It is now read-only.
This repository was archived by the owner on Sep 23, 2024. It is now read-only.

Existing tables not found or updated correctly if incoming schema name isn't lower cased #70

@tombriggsallego

Description

@tombriggsallego

Describe the bug
If the incoming schema isn't all lower case (e.g. "MySchema") the code will conclude the tables don't exist and try to recreate them.

To Reproduce
Steps to reproduce the behavior:

  1. Create a schema in MySQL with a mixed-case name (e.g. "MySchema")
  2. Create a table in said schema and put some data in it
  3. Set up a pipeline from MySQL to Postgres and run it. Let target-postgres create the destination schema. This will result in a schema in PG named "myschema"
  4. Add some new data to the table in MySQL.
  5. Re-run the pipeline. target-postgres will log a message saying the table doesn't exist and try to recreate it.

Note that the CREATE TABLE succeeds without error because it includes an IF NOT EXISTS clause. However, if you add a column to your source table the pipeline will fail - because the code thinks the table doesn't exist it tries to create it rather than update the schema.

Expected behavior
The existing table should be recognized, no log message should be generated, and any schema updates should be applied.

Your environment

  • Version of target: git latest
  • Version of python 3.8
  • Meltano latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions