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

using knex migrations and seed #145

Closed
capan opened this issue Jul 26, 2021 Discussed in #106 · 1 comment
Closed

using knex migrations and seed #145

capan opened this issue Jul 26, 2021 Discussed in #106 · 1 comment

Comments

@capan
Copy link

capan commented Jul 26, 2021

Discussed in #106

Originally posted by codelover2k May 2, 2021
hi!
I am using knex with multiple migration files.

I know that you can use knex with pg-mem, but is there a way to tell pg-meme to use knex and create the database with the multiple migration files and use knex seed functionality all in one step for each test?

A simple example would be great. Thanks!

During the execution of migration files receiving error even with valid SQL queries. E.g;

💔 Your query failed to parse.
This is most likely due to a SQL syntax error. However, you might also have hit a bug, or an unimplemented feature of pg-mem.
If this is the case, please file an issue at https://github.com/oguimbal/pg-mem along with a query that reproduces this syntax error.

👉 Failed query:

    alter table "business" add column "iban" text, add column "deposit_period" integer;

💀 Syntax error at line 1 col 46:

  alter table "business" add column "iban" text,
                                               ^
Unexpected comma token: ",". Instead, I was expecting to see one of the following:

    - A "dot" token
    - A "lparen" token
    - A "kw_array" token
    - A "lbracket" token
    - A "kw_collate" token
    - A "kw_constraint" token
    - A "kw_unique" token
    - A "kw_null" token
    - A "kw_default" token
    - A "kw_check" token
    - A "kw_primary" token
    - A "kw_not" token
    - A "word" token
    - A "semicolon" token
@oguimbal
Copy link
Owner

oguimbal commented Jul 26, 2021

This is on my todo list... the parser does not support parsing ALTER statements that are altering more than one columns. See this issue

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