Trying to get Drizzle, Lucia and Vercel-postress to work together (no changes to schema detected)

Hi! I'm new to drizzle and lucia and am just having a problem setting up both with vercel-postgres: I'm creating an adapter for Lucia in my schema.ts: export const createAdapter = (db: PgDatabase<any, any, any>) => new DrizzlePostgreSQLAdapter(db, sessionTable, userTable); and using it in db/index.ts. But this doesn't allow drizzle to see the session or user schemas (no changes are detected when I drizzle-kit push )
import { drizzle } from "drizzle-orm/vercel-postgres";
import { sql } from "@vercel/postgres";
import * as schema from "./schema";

export const db = drizzle(sql, { schema });
export const adapter = schema.createAdapter(db);
import { drizzle } from "drizzle-orm/vercel-postgres";
import { sql } from "@vercel/postgres";
import * as schema from "./schema";

export const db = drizzle(sql, { schema });
export const adapter = schema.createAdapter(db);
Any ideas? Sorry if it's obvious! Nick
5 Replies
nr7751
nr77512mo ago
I have the exact same setup Drizzle, Lucia and Vercel PostgreSQL: generate genereates the right migration files , but when I try to migrate i claims no changes were made the db deosn't get changed. Maybe it's a common isse?
Nick
Nick2mo ago
When did you first have the problem? You make any headway with it? Fixed by moving the adapter out of schema.ts and into db/index.ts and importing the schemas.
nr7751
nr77512mo ago
@Nick , good thta you solved it ! It's not related to my issue then. Mine is that Drizzles generates migrations byt doesn't apply them.
Nick
Nick2mo ago
Yeah sorry I couldn't be more of a help
nr7751
nr77512mo ago
@Nick no worries. I solved it. Great education 😄 . Deleting migrations folder and table and using push to bypass migrations apparently solved the issue
Want results from more Discord servers?
Add your server
More Posts
Drizzle kit generating migrations but not migrating, claiming all remains the sameCan anybody help? I changed my schema to add 1 column to 2 new tables. I hadn’t updated kit in a loncould someone show me the way to do this query using drizzleI have a query with a one to many join but I don't seem to be able to array agg and group by to stopHow to make all relations be deleted when user is removed?Hello! I'm trying to get my head around for table relations, and just can't seem to get this figuredMany to many flatten responseI'm struggling to understand why does drizzle work this way and why there isnt an easy way to flatteCloudflare D1 using drizzle - issue with boolean data typeEven if the SQlite column is typed as boolean, I am getting an integer value and having to explicitlERROR WHILE INSTALLING DRIZZLE-ORM``` $ npm i drizzle-orm npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR!duplicate key value violates unique constraint when trying to insertI have this simple table: ```javascript export const ExperimentData = pgTable('experiment_data', { PostgresError: sorry, too many clients already```js import { drizzle } from 'drizzle-orm/postgres-js'; import { migrate } from 'drizzle-orm/postgrUnable to run migration pgenum``` import { pgTable, serial, text, varchar, pgEnum, numeric } from 'drizzle-orm/pg-core'; const rodrizzle-kit can't connect to Vercel postgres instanceI am following theo's `From 0 to production - The Modern React Tutorial` but I am unable to use driz