using knex migrations and seed #106
Replies: 2 comments 6 replies
-
Hi, There is no difference between an instance of Knex you would create as usual, and an instance of Knex you can create through pg-mem. I dont know Knex enough to answer the question "how to do it ?" (I dont know how to use migration files with it), but I can answer: "Like you would with Knex"... I suppose you do that through Knex configuration options, so: const pgMem = newDb();
const knex = db.adapters.createKnex(0, { /* PUT YOUR KNEX OPTIONS HERE */ }); |
Beta Was this translation helpful? Give feedback.
-
I have a similar question; The error says;
What is wrong with this SQL query? alter table "business" add column "iban" text, add column "deposit_period" integer |
Beta Was this translation helpful? Give feedback.
-
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!
Beta Was this translation helpful? Give feedback.
All reactions