I accidentally deleted a table by hand, as well as the model and migration that corresponded to it... Next I generated the same model and migration again using php oil.... When I tried to migrate again in order to create the same table for a second time, it told me that I'm on the latest migration... Now I'm going to create the table by hand because I don't know what is going on..
Has anyone had this problem? how did you solve it?
You can run migrations only once. The Migrate class keeps track of migrations in both the migrations table and the migrations config file, and both have to be in sync.
If you only have a problem locally (i.e. it is not a deployed application), you could create a dummy migration for the number you deleted, then migrate down to that number, replace the dummy with the newly created migration, and migrate up again. That would cause dataloss if that means tables would be deleted.
If that is not possible, leave the dummy migration (with an empty up() and down() method), and create a new migration with the next new sequence number to create the table again, and migrate up like normal.
If this is a deployed application, get the migration file and table (structure) back from your deployment, problem solved.
Oh, and while you are at it: start using a versioning system like git, and commit your changes regularly. And never loose anything again.