- Remove unnecessary schema file: Delete
lib/legacy-schema.ts
file as it is only used when migrating from Prisma. - Initialize Schema: The Drizzle schema located in
lib/schema.ts
will be used for database queries. - Apply changes to the database: Run the
drizzle-kit push
command 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.ts
file and renamelib/legacy-schema.ts
tolib/schema.ts
. - Update database schema:
email
column inusers
table is set tonot null
to ensure compatibility with drizzle next-auth adapter. Apply this change by running thedrizzle-kit push
command. Learn more aboutpush
command here. - Complete migration: You are now ready to use this template with Drizzle ORM.