Skip to content
Advertisement

Tag: laravel-migrations

SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘proform_id’ doesn’t exist in table

After php artisan migrate:fresh I get error: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘proform_id’ doesn’t exist in table (SQL: alter table proforms add constraint proforms_proform_id_foreign foreign key (proform_id) references proforms (id) on delete cascade) This is migration which generates error: 2020_08_08_093303_create_dynamic_field.php This is migration asociated with it: 2020_07_29_101958_proforms.php Answer This looks odd to me: It looks like

Drop Unique Index Laravel

I kept getting this while run php artisan migrate SQLSTATE[42000]: Syntax error or access violation: 1091 Can’t DROP ’email’; check that column/key exists While I see that email is exist on my database. My migration script. I was trying to drop the unique constraint. Did I forget to clear any caches ? Any hints for me ? Answer When dropping

Laravel Add a new column to existing table in a migration

I can’t figure out how to add a new column to my existing database table using the Laravel framework. I tried to edit the migration file using… In terminal, I execute php artisan migrate:install and migrate. How do I add new columns? Answer To create a migration, you may use the migrate:make command on the Artisan CLI. Use a specific

Advertisement