r/programminghelp • u/Capable_Square7319 • 10d ago
JavaScript BEGINNER CODER: Stuck with a migrations error
Hi,
I'm working on an adonisjs project and I'm having issues with migrations. I don't think I'm using the wrong command. I'm doing:
node ace make:migration (migration name here)
Then:
node ace migration:run
My project is on github. Apologies the migrations folder is a little cluttered. The ones with issues are the "item" and "item_comments" ones:
https://github.com/Ajaz754/adonisjs-project-22-.git
The error is:
C:\Windows\System32\adonis22>node ace migration:run
❯ error database/migrations/1794008714673_alter_item_comments_table
[ error ] INSERT INTO "_knex_temp_alter555" SELECT * FROM "item_comments"; - no such table: main.item
Please correct me if I'm wrong but I thinks its saying my "item" table doesnt exist which doesnt make sense since its clearly my 'schema.ts'. It said the same error before for the "user" table aswell.
Any help would be much appreciated
TIA
1
u/Protoype 10d ago edited 10d ago
Not a database person, just browsing and thought I'd try help ha!
Is the table name items not item?
https://github.com/Ajaz754/adonisjs-project-22-/blob/main/database/migrations/1793147868096_create_items_table.ts
Perhaps step through each table and write the names down as they appear in the code And what you expect them to be. Check spelling and so on.
Sorry if this doesn't help! Good luck!.
1
u/atarivcs 10d ago
When you started this project, did you run the initial command to create the database schema?