Quickly inspect the current schema

Is there something in Adonis which is the equivalent of the Ruby on Rails ‘schema.rb’? When I want to quickly determine the name of a column in a table (e.g.), I’d like to (as I do in Rails projects), stay in my IDE/editor and inspect a file… as opposed to switching over to my Postgres inpsection tool, maybe waiting for the DB to boot up (using Docker images, it may not already be running), etc.

Thanks

1 Like

Hey @gap777! :wave:

No, we don’t have something similar to the schema.rb of Rails.
However, it might be a good a feature to add. I’ll probably create a RFC for this after V5 release.

1 Like

@gap777

Hi, I’m also coming from Rails,
you can create a script to run after the migrations that creates the schema:

for mysql:

mysqldump --no-data -u youruser -p yourdb > db/schema.sql <- without data

postgresql:

pg_dump -s databasename > db/schema.dump

Regards.

2 Likes

Thanks! That’s a good idea.