#6316·monica

Installation fails due to failing migrations.

Author: putzwasserCreated Sep 7, 2022Updated Jun 18, 2026

Describe the bug The installation fails, but you won't notice it until I try to login.

The server yields this error:

Whoops! Something went wrong. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'address_book_id' in 'where clause' (SQL: select accounts., (select count() from contacts where accounts.id = contacts.account_id and address_book_id is null and contacts.deleted_at is null) as contacts_count, (select count() from reminders where accounts.id = reminders.account_id) as reminders_count, (select count() from notes where accounts.id = notes.account_id) as notes_count, (select count() from activities where accounts.id = activities.account_id) as activities_count, (select count() from gifts where accounts.id = gifts.account_id) as gifts_count, (select count(*) from tasks where accounts.id = tasks.account_id) as tasks_count from accounts where accounts.id = 1 limit 1)

I'm pretty sure, it's because it won't apply all the migrations during installation.

php artisan setup:production [email protected] --password=myPassw0rd -v runs without error. But:

$ php artisan migrate:status
+------+------------------------------------------------------------------------------------+-------+
| Ran? | Migration                                                                          | Batch |
+------+------------------------------------------------------------------------------------+-------+
| Yes  | 2014_10_12_000000_create_users_table                                               | 1     |
| Yes  | 2014_10_12_100000_create_password_resets_table                                     | 1     |
| Yes  | 2016_06_01_000001_create_oauth_auth_codes_table                                    | 1     |
| Yes  | 2016_06_01_000002_create_oauth_access_tokens_table                                 | 1     |
| Yes  | 2016_06_01_000003_create_oauth_refresh_tokens_table                                | 1     |
| Yes  | 2016_06_01_000004_create_oauth_clients_table                                       | 1     |
| Yes  | 2016_06_01_000005_create_oauth_personal_access_clients_table                       | 1     |
| Yes  | 2016_06_07_234741_create_account_table                                             | 1     |
| Yes  | 2016_06_08_003006_add_account_info_table                                           | 1     |
| Yes  | 2016_06_08_005413_create_contacts_table                                            | 1     |
| Yes  | 2016_06_25_224219_create_reminder_type_table                                       | 1     |
| Yes  | 2016_06_28_191025_create_tasks_table                                               | 1     |
| Yes  | 2016_06_30_185050_create_notes_table                                               | 1     |
| Yes  | 2016_07_25_133835_add_width_field                                                  | 1     |
| Yes  | 2016_08_28_122938_create_kids_table                                                | 1     |
| Yes  | 2016_08_28_215159_create_relations_table                                           | 1     |
| Yes  | 2016_09_03_202027_add_reminder_id_to_contacts                                      | 1     |
| Yes  | 2016_09_05_134937_add_last_talked_to_field                                         | 1     |
| Yes  | 2016_09_05_135927_add_people_id_to_contacts                                        | 1     |
| Yes  | 2016_09_05_145111_add_name_info_to_peoples                                         | 1     |
| Yes  | 2016_09_06_213550_create_activity_type_table                                       | 1     |
| Yes  | 2016_09_10_164406_create_jobs_table                                                | 1     |
| Yes  | 2016_09_10_170122_create_notifications_table                                       | 1     |
| Yes  | 2016_09_12_014120_create_failed_jobs_table                                         | 1     |
| Yes  | 2016_09_30_014720_add_kid_to_reminder                                              | 1     |
| Yes  | 2016_10_15_024156_add_deleted_at_to_users                                          | 1     |
| Yes  | 2016_10_19_155139_create_cache_table                                               | 1     |
| Yes  | 2016_10_19_155800_create_sessions_table                                            | 1     |
| Yes  | 2016_10_21_022941_add_statistics_table                                             | 1     |
| Yes  | 2016_10_24_013543_add_journal_setting_to_users                                     | 1     |
| Yes  | 2016_10_24_014257_create_journal_tables                                            | 1     |
| Yes  | 2016_10_28_002518_add_metric_to_settings                                           | 1     |
| Yes  | 2016_11_01_014353_create_activities_table                                          | 1     |
| Yes  | 2016_11_01_015957_add_icon_column                                                  | 1     |
| Yes  | 2016_11_03_150307_add_activity_location_to_activities                              | 1     |
| Yes  | 2016_11_09_013049_add_events_table                                                 | 1     |
| Yes  | 2016_12_08_011555_remove_type_from_notes                                           | 1     |
| Yes  | 2016_12_13_133945_add_gifts_table                                                  | 1     |
| Yes  | 2016_12_28_150831_change_title_column                                              | 1     |
| Yes  | 2017_01_14_200815_add_facebook_columns_to_users_table                              | 1     |
| Yes  | 2017_01_15_045025_add_colors_to_users                                              | 1     |
| Yes  | 2017_01_22_142645_add_fields_to_contacts                                           | 1     |
| Yes  | 2017_01_23_043831_change_people_to_contact_for_kids                                | 1     |
| Yes  | 2017_01_26_013524_change_people_to_significantother                                | 1     |
| Yes  | 2017_01_26_022852_change_notes_to_contact                                          | 1     |
| Yes  | 2017_01_26_034553_add_notes_count_to_contact                                       | 1     |
| Yes  | 2017_01_27_024356_change_people_in_events                                          | 1     |
| Yes  | 2017_01_28_180156_remove_deleted_at_from_significant_others                        | 1     |
| Yes  | 2017_01_28_184901_remove_deleted_at_from_kids                                      | 1     |
| Yes  | 2017_01_28_193913_remove_deleted_at_from_notes                                     | 1     |
| Yes  | 2017_01_28_222114_remove_viewed_at_from_contacts                                   | 1     |
| Yes  | 2017_01_29_175146_remove_delete_at_from_activities                                 | 1     |
| Yes  | 2017_01_29_175629_add_number_activities_to_contacts                                | 1     |
| Yes  | 2017_01_31_025849_add_activity_statistics_table                                    | 1     |
| Yes  | 2017_02_02_232450_add_confirmation                                                 | 1     |
| Yes  | 2017_02_04_225618_change_reminders_table                                           | 1     |
| Yes  | 2017_02_05_035925_add_gifts_metrics_to_contacts                                    | 1     |
| Yes  | 2017_02_05_041740_change_gifts_table                                               | 1     |
| Yes  | 2017_02_05_042122_change_people_to_contact_for_gifts                               | 1     |
| Yes  | 2017_02_07_041607_change_tasks_table                                               | 1     |
| Yes  | 2017_02_07_051355_add_number_tasks_to_contact                                      | 1     |
| Yes  | 2017_02_08_002251_change_number_tasks_contact                                      | 1     |
| Yes  | 2017_02_08_025358_add_sort_preferences_to_users                                    | 1     |
| Yes  | 2017_02_10_195613_remove_notifications_table                                       | 1     |
| Yes  | 2017_02_10_214714_remove_people_table                                              | 1     |
| Yes  | 2017_02_10_215405_remove_entities_table                                            | 1     |
| Yes  | 2017_02_10_224355_calculate_statistics                                             | 1     |
| Yes  | 2017_02_11_154900_add_avatars_to_contacts                                          | 1     |
| Yes  | 2017_02_12_134220_create_entries_table                                             | 1     |
| Yes  | 2017_05_03_155254_move_significant_other_data                                      | 1     |
| Yes  | 2017_05_04_164723_remove_contact_encryption                                        | 1     |
| Yes  | 2017_05_04_185921_add_title_to_activities                                          | 1     |
| Yes  | 2017_05_04_193252_alter_activity_nullable                                          | 1     |
| Yes  | 2017_05_08_164514_remove_encryption_tasks                                          | 1     |
| Yes  | 2017_05_30_002239_remove_predefined_reminders                                      | 1     |
| Yes  | 2017_05_30_023116_create_money_table                                               | 1     |
| Yes  | 2017_06_07_173437_add_multiple_genders_choices                                     | 1     |
| Yes  | 2017_06_10_152945_add_social_networks_to_contacts                                  | 1     |
| Yes  | 2017_06_10_155349_create_currencies_data                                           | 1     |
| Yes  | 2017_06_11_025227_remove_encryption_journal                                        | 1     |
| Yes  | 2017_06_11_110735_change_unique_constraint_for_contacts                            | 1     |
| Yes  | 2017_06_13_035059_remove_gifts_encryption                                          | 1     |
| Yes  | 2017_06_13_195740_add_company_to_contacts                                          | 1     |
| Yes  | 2017_06_14_131803_remove_bern_timezone                                             | 1     |
| Yes  | 2017_06_14_132911_add_zar_currency_to_currencies_table                             | 1     |
| Yes  | 2017_06_16_215256_add_about_who_to_reminders                                       | 1     |
| Yes  | 2017_06_17_010900_fix_contacts_table                                               | 1     |
| Yes  | 2017_06_17_153814_refactor_user_table                                              | 1     |
| Yes  | 2017_06_19_105842_add_stripe_fields_to_users                                       | 1     |
| Yes  | 2017_06_20_121345_add_invitations_statistics                                       | 1     |
| Yes  | 2017_06_22_210813_add_name_order_to_users                                          | 1     |
| Yes  | 2017_06_27_134704_create_import_table                                              | 1     |
| Yes  | 2017_06_29_211725_add_import_job_to_statistics                                     | 1     |
| Yes  | 2017_06_29_230523_add_gravatar_url_to_users                                        | 1     |
| Yes  | 2017_07_02_155736_create_tags_table                                                | 1     |
| Yes  | 2017_07_04_132743_add_tags_to_statistics                                           | 1     |
| Yes  | 2017_07_09_164312_update_bad_translation_key                                       | 1     |
| Yes  | 2017_07_12_014244_create_calls_table                                               | 1     |
| Yes  | 2017_07_17_005012_drop_reminders_count_from_contacts                               | 1     |
| Yes  | 2017_07_18_215312_add_danish_kroner_to_currencies_table                            | 1     |
| Yes  | 2017_07_18_215758_add_indian_rupee_to_currencies_table                             | 1     |
| Yes  | 2017_07_19_094503_add_brazilian_real_to_currencies                                 | 1     |
| Yes  | 2017_07_22_153209_create_instance_table                                            | 1     |
| Yes  | 2017_07_26_220021_change_contacts_table                                            | 1     |
| Yes  | 2017_08_02_152838_change_string_to_boolean_for_reminders                           | 1     |
| Yes  | 2017_08_06_085629_change_events_data                                               | 1     |
| Yes  | 2017_08_06_153253_move_kids_to_contacts                                            | 1     |
| Yes  | 2017_08_16_041431_add_contact_avatar_location                                      | 1     |
| Yes  | 2017_08_21_224835_remove_paid_limitations_for_current_users                        | 1     |
| Yes  | 2017_09_10_125918_remove_unusued_counters                                          | 1     |
| Yes  | 2017_09_13_095923_add_tracking_table                                               | 1     |
| Yes  | 2017_09_13_191714_add_partial_notion                                               | 1     |
| Yes  | 2017_10_14_083556_change_gift_column_structure                                     | 1     |
| Yes  | 2017_10_17_170803_change_gift_structure                                            | 1     |
| Yes  | 2017_10_19_134816_create_activity_contact_table                                    | 1     |
| Yes  | 2017_10_19_135215_move_activities_to_pivot_table                                   | 1     |
| Yes  | 2017_10_25_102923_remove_contact_id_activities_table                               | 1     |
| Yes  | 2017_11_01_122541_add_met_through_to_contacts                                      | 1     |
| Yes  | 2017_11_02_202601_add_is_dead_to_contacts                                          | 1     |
| Yes  | 2017_11_10_174654_create_contact_fields_table                                      | 1     |
| Yes  | 2017_11_10_181043_migrate_contacts_information                                     | 1     |
| Yes  | 2017_11_10_202620_move_addresses_from_contact_to_addresses                         | 1     |
| Yes  | 2017_11_10_204035_delete_contact_fields_from_contacts                              | 1     |
| Yes  | 2017_11_20_115635_change-amount-to-double-on-debts                                 | 1     |
| Yes  | 2017_11_27_083043_add_more_statistics                                              | 1     |
| Yes  | 2017_11_27_134403_add_new_avatar_to_contacts                                       | 1     |
| Yes  | 2017_11_27_202857_change_tasks_table_structure                                     | 1     |
| Yes  | 2017_12_01_113748_update_notes                                                     | 1     |
| Yes  | 2017_12_04_164831_create_ages_table                                                | 1     |
| Yes  | 2017_12_04_165421_move_ages_data                                                   | 1     |
| Yes  | 2017_12_10_181535_remove_important_dates_table                                     | 1     |
| Yes  | 2017_12_10_205328_add_account_id_to_activities                                     | 1     |
| Yes  | 2017_12_10_214545_add_last_consulted_at_to_contacts                                | 1     |
| Yes  | 2017_12_13_115857_create_day_table                                                 | 1     |
| Yes  | 2017_12_21_163616_update_journal_entries_with_existing_activities                  | 1     |
| Yes  | 2017_12_21_170327_add_google2fa_secret_to_users                                    | 1     |
| Yes  | 2017_12_24_115641_create_pets_table                                                | 1     |
| Yes  | 2017_12_31_114224_add_dashboard_tab_to_users                                       | 1     |
| Yes  | 2018_01_15_105858_create_additional_reminders_table                                | 1     |
| Yes  | 2018_01_16_203358_add_gift_received                                                | 1     |
| Yes  | 2018_01_16_212320_rename_gift_columns                                              | 1     |
| Yes  | 2018_01_17_230820_add_gift_tab_view_to_users                                       | 1     |
| Yes  | 2018_01_27_014146_add_custom_gender                                                | 1     |
| Yes  | 2018_02_25_202752_change_locale_in_db                                              | 1     |
| Yes  | 2018_02_28_223747_update_notification_table                                        | 1     |
| Yes  | 2018_03_03_204440_create_relationship_type_table                                   | 1     |
| Yes  | 2018_03_18_085815_populate_default_relationship_type_tables                        | 1     |
| Yes  | 2018_03_18_090209_populate_relationship_type_tables_with_default_values            | 1     |
| Yes  | 2018_03_18_090345_migrate_current_relationship_table_to_new_relationship_structure | 1     |
| Yes  | 2018_03_24_083258_migrate_offsprings                                               | 1     |
| Yes  | 2018_04_04_220850_create_default_modules_table                                     | 1     |
| Yes  | 2018_04_04_222608_create_account_modules_table                                     | 1     |
| Yes  | 2018_04_10_205655_fix_production_error                                             | 1     |
| Yes  | 2018_04_10_222515_migrate-modules                                                  | 1     |
| Yes  | 2018_04_13_131008_fix-contacts-data                                                | 1     |
| Yes  | 2018_04_13_205231_create_changes_table                                             | 1     |
| Yes  | 2018_04_14_081052_fix_wrong_gender                                                 | 1     |
| Yes  | 2018_04_19_190239_stay_in_touch                                                    | 1     |
| Yes  | 2018_05_06_061227_external_countries                                               | 1     |
| Yes  | 2018_05_07_070458_create_terms_table                                               | 1     |
| Yes  | 2018_05_13_110706_add_ex_wife_husband_relationship                                 | 1     |
| Yes  | 2018_05_16_143631_add_nickname_to_contacts                                         | 1     |
| Yes  | 2018_05_16_214222_add_timestamps_to_currencies                                     | 1     |
| Yes  | 2018_05_20_121028_accept_terms                                                     | 1     |
| Yes  | 2018_05_20_225034_change_name_order_user-_preferencies                             | 1     |
| Yes  | 2018_05_24_160546_fix-inconsistant-reminder-time                                   | 1     |
| Yes  | 2018_06_10_191450_add_love_metadata_relationshisp                                  | 1     |
| Yes  | 2018_06_10_221746_migrate_entries_objects                                          | 1     |
| Yes  | 2018_06_11_184017_change_default_user_table                                        | 1     |
| Yes  | 2018_06_13_000100_create_u2f_key_table                                             | 1     |
| Yes  | 2018_06_14_212502_change_default_name_order_user_table                             | 1     |
| Yes  | 2018_07_03_204220_create_default_activity_type_groups_table                        | 1     |
| Yes  | 2018_07_08_104306_update-timestamps-timezone                                       | 1     |
| Yes  | 2018_07_26_104306_create-conversations                                             | 1     |
| Yes  | 2018_08_06_145046_add_starred_to_contacts                                          | 1     |
| Yes  | 2018_08_09_18000_fix-empty-reminder-time                                           | 1     |
| Yes  | 2018_08_18_180426_add_legacy_free_plan                                             | 1     |
| Yes  | 2018_08_29_124804_add_conversations_to_statistics                                  | 1     |
| Yes  | 2018_08_29_222051_add_conversations_to_modules                                     | 1     |
| Yes  | 2018_08_31_020908