Migration file name is not in plural although the database table is: why?


#1

I just noticed that in database/migrations I have a schema file named without s:

receipt1
Notice that I have receipt instead of receipts. (the.js~ file is just a backup file, do not care about it)

I went to my database to see if the related table respects the convention or not:
receipt2

Is this situation normal or not?

Billal Begueradj


#2

I found it is because when I run adonis make:model Receipt -m then the migration file is not generated with the name of the model in plural, but still running the migration (adonis migration:run) produces tables in plural name.

When I run adonis make:migration receipts the migration file is generated in its plural form.

This can be confusing for newbies because the documentation does not say anything about this (but rather confuses).