- Remove unnecessary schema file: Delete
lib/legacy-schema.tsfile as it is only used when migrating from Prisma. - Initialize Schema: The Drizzle schema located in
lib/schema.tswill be used for database queries. - Apply changes to the database: Run the
drizzle-kit pushcommand to apply your changes to the database. Learn more about the push command here. - Begin using the template: You can now start using this template with Drizzle ORM.
- Replace the schema file: Remove the existing
lib/schema.tsfile and renamelib/legacy-schema.tstolib/schema.ts. - Update database schema:
emailcolumn inuserstable is set tonot nullto ensure compatibility with drizzle next-auth adapter. Apply this change by running thedrizzle-kit pushcommand. Learn more aboutpushcommand here. - Complete migration: You are now ready to use this template with Drizzle ORM.