Laravel Nova - Table 'action_events' already exists

Posted 1 month ago by connor11528

Hi there, I am trying to run my migrations with Laravel Nova installed. I got everything running and deployed to production, but locally my migrations broke. I have tried php artisan migrate:reset, but afterwards I am getting an error that the "action_events" table already exists:

$ php artisan migrate
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table
Migrating: 2017_11_16_212051_create_companies_table
Migrated:  2017_11_16_212051_create_companies_table
Migrating: 2018_01_01_000000_create_action_events_table

In Connection.php line 664:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'action_events' already exists (SQL: create table `action_ev
  ents` (`id` bigint unsigned not null auto_increment primary key, `batch_id` char(36) not null, `user_id` int unsigned not n
  ull, `name` varchar(191) not null, `actionable_type` varchar(191) not null, `actionable_id` int unsigned not null, `target_
  type` varchar(191) not null, `target_id` int unsigned not null, `model_type` varchar(191) not null, `model_id` int unsigned
   null, `fields` text not null, `status` varchar(25) not null default 'running', `exception` text not null, `created_at` tim
  estamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')


In PDOStatement.php line 119:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'action_events' already exists


In PDOStatement.php line 117:

  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'action_events' already exists

This kind of makes sense because it said it created the "action_events" table. I have two create_actions_events migrations, one in, vendor/laravel/nova/database/migrations and one in nova/database/migrations.

My question is, why are the migrations running twice and how do I get it to stop? What's the best practice here for working with Nova and database migrations?

UPDATE:

I was able to get around this in my local environment by running migrate:reset and then going into sequel pro and deleting the action_events table. For some reason php artisan migrate:reset was not dropping that table.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.