Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 1.12 KB

migrate-to-drizzle.md

File metadata and controls

12 lines (9 loc) · 1.12 KB

If you directly start the project with Drizzle ORM

  1. Remove unnecessary schema file: Delete lib/legacy-schema.ts file as it is only used when migrating from Prisma.
  2. Initialize Schema: The Drizzle schema located in lib/schema.ts will be used for database queries.
  3. 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.
  4. Begin using the template: You can now start using this template with Drizzle ORM.

If you migrating from Prisma

  1. Replace the schema file: Remove the existing lib/schema.ts file and rename lib/legacy-schema.ts to lib/schema.ts.
  2. Update database schema: email column in users table is set to not null to ensure compatibility with drizzle next-auth adapter. Apply this change by running the drizzle-kit push command. Learn more about push command here.
  3. Complete migration: You are now ready to use this template with Drizzle ORM.