amacneil / dbmate

🚀 A lightweight, framework-agnostic database migration tool.
MIT License
5.32k stars 266 forks source link

Comments (on columns) that include line breaks are never created. #468

Closed pmioduszewski closed 1 year ago

pmioduszewski commented 1 year ago

Description I already had some comments with line breaks in my existing postgresql db. I've used the dbmate dump command and moved output to the _init.sql migration file. After deleting the existing db and trying to recreate it from _init.sql using dbmate up, I've noticed that comments with line breaks were skipped without error.

Steps To Reproduce

  1. Example SQL in migrations that will never be applied:
    COMMENT ON COLUMN my_schema.my_table.my_column IS '1-some comment before the line break
    2-awesome comment in the new line
    3-another comment
    ';
  2. This comment will NOT be created in the db. No errors are shown either.

Expected Behavior Line breaks should be escaped inside comments.

I will be grateful for any workaround.

pmioduszewski commented 1 year ago

Ok, for some reason, now it's working 🤷‍♂️ . I think that was the issue with DataGrip; after restarting, the comments appeared. 😄