Skip to content

Migration error when using CockroachDB #43

@tlvenn

Description

@tlvenn

When trying to run the migration with Postgrex & CockroachDB, the following error occurs:

[info] execute "INSERT INTO public.error_tracker_meta (key, value)\nVALUES ('migration_version', '2'), ('migration_timestamp', 1723522363)\nON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value\n"
** (Postgrex.Error) ERROR 42804 (datatype_mismatch) VALUES types int and string cannot be matched

    query: INSERT INTO public.error_tracker_meta (key, value)
VALUES ('migration_version', '2'), ('migration_timestamp', 1723522363)
ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value

I am wondering if we could rewrite it following this pattern, it will probably fix the issue.

INSERT INTO t (a, b, ..., n)
VALUES ('1', '2', ..., 'n')
ON CONFLICT DO UPDATE SET
  a = '1',
  b = '2',
  ...
  n = 'n';

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