I'm currently utilizing the drizzle auth template and attempting to customize it for Role Based Authentication. I've made adjustments in the db.ts file to incorporate roles.
import { drizzle } from 'drizzle-orm/postgres-js';
import { pgTable, serial, varchar } from 'drizzle-orm/pg-core';
import { eq } from 'drizzle-orm';
import postgres from 'postgres';
import { genSaltSync, hashSync } from 'bcrypt-ts';
// Here is some sample code with modifications related to roles
// Code snippet goes here...
However, when trying to update the database for the new column, I encountered an issue where drizzle does not function properly, as I am unable to migrate using CLI or open the studio.
(base) PS C:\Users\user\Documents\Projects\TemplatingDocuments\> npx drizzle-kit migrate
>> npx drizzle-kit push
No config path provided, using default 'drizzle.config.ts'
Reading config file 'C:\Users\user\Documents\Projects\TemplatingDocuments\app\drizzle.config.ts'
Using 'pg' driver for database querying
// Error message and stack trace details go here...
Below is a glimpse of my package.json:
{
// Package JSON content goes here...
}
This is the content of my tsconfig.json:
{
// TSConfig content goes here...
}
And here's the content of my drizzle.config.ts:
import 'dotenv/config';
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
out: './drizzle',
schema: './app/db.ts',
dialect: 'postgresql',
dbCredentials: {
url: process.env.POSTGRES_URL!,
},
});
I have attempted updating packages and specifying to use modules in package.json, but this action affects the functionality of nextJS.