In db first approach, we already have db, it has two schemas like auth and audit. auth schema contains user, role, permission table, audit schema contains session, policies. how to create model and migration files?
How to classify Schema nama in adonisjs 6 migration file?
-
Hi sivaclikry! As of right now, there is no way to generate models and migrations from an existing database. So, you'll want to manually define the models and migrations you'll need.
I have a package that is a work in progress, you're welcome to try it. It'll generate models for you, but it doesn't currently do migrations. Right now, it'll work best with MySQL & PostgreSQL.
To install, you can run:
npm add @adocasts.com/generate-models
Copied!Ensure your db connection is defined and working in your
.env
, then generate with:node ace generate:models
Copied!0