2

I created a table using a migration. But when I want to create second one using different migration, can't do it. In terminal give this message:

[PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hrm.timelogs' doesn't exist

laravel log is here:

 10 /home/tx01/Desktop/hrm-app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(82): Illuminate\Database\Migrations\Migrator->runMigrationList(Array, false)

 11 /home/tx01/Desktop/hrm-app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(70): Illuminate\Database\Migrations\Migrator->run('/home/tx01/Desk...', false)

12 /home/tx01/Desktop/hrm-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(112): Illuminate\Database\Console\Migrations\MigrateCommand->fire()

13 /home/tx01/Desktop/hrm-app/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

14 /home/tx01/Desktop/hrm-app/vendor/laravel/framework/src/Illuminate/Console/Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

15 /home/tx01/Desktop/hrm-app/vendor/symfony/console/Symfony/Component/Console/Application.php(889): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

16 /home/tx01/Desktop/hrm-app/vendor/symfony/console/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Database\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

17 /home/tx01/Desktop/hrm-app/vendor/symfony/console/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

18 /home/tx01/Desktop/hrm-app/artisan(59): Symfony\Component\Console\Application->run()

19 {main} [] []
General Grievance
  • 4,555
  • 31
  • 31
  • 45
Anup Ghosh
  • 107
  • 1
  • 6
  • Can you share the laravel log? In linux it works by going to your laravel project and entering in command line: `tail -f app/storage/logs/laravel.log` – Y M Nov 17 '14 at 06:19

2 Answers2

0

This question seems similar to this one. See if that question helps you. If it doesn't, then you might want to post your migration code in your original question so we can see what might be going wrong.

Community
  • 1
  • 1
BrokenBinary
  • 7,731
  • 3
  • 43
  • 54
0

Assuming you got this error when ruuning application. So you may need to tell model which table it representing only if table name is differ from model name.

Second if don't how write a migration file please follow laravel docs.

Last you write multiple table schema on single migration file. No preferable.

Hafijul Islam
  • 24
  • 1
  • 5