How to classify Schema nama in adonisjs 6 migration file?

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?

Join The Discussion! (1 Replies)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 3 months ago

    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

    Ensure your db connection is defined and working in your .env , then generate with:

    node ace generate:models

    0

    Please sign in or sign up for free to reply