josh-dev627
josh-dev627
Explore posts from servers
DTDrizzle Team
Created by josh-dev627 on 4/6/2024 in #help
How to run migrations that is inside node_modules?
I have created a package for my application that I can install for my main application, the package has it's own schema and migrations. If I install the package in my application how would I run the migration if it is inside the node_modules?
2 replies
DTDrizzle Team
Created by josh-dev627 on 4/5/2024 in #help
Error in studio when running migrate, but no error when running push
Everytime I manually run my migrator which is: pnpm tsx migrate.ts, when I open my studio I always get an error like: SQLITE_ERROR: no such column: phone or any changes that I applied with it. However, when running push to apply the same changes, I don't get the same error on studio. Is this something we should be concerned about? or this normal? This is how my migrate.ts looks like:
import { migrate } from "drizzle-orm/libsql/migrator";
import { client, db } from "./app/db";
// This will run migrations on the database, skipping the ones already applied
await migrate(db, { migrationsFolder: "./drizzle/migrations" });
// Don't forget to close the connection, otherwise the script will hang
await client.close();
import { migrate } from "drizzle-orm/libsql/migrator";
import { client, db } from "./app/db";
// This will run migrations on the database, skipping the ones already applied
await migrate(db, { migrationsFolder: "./drizzle/migrations" });
// Don't forget to close the connection, otherwise the script will hang
await client.close();
1 replies