Closed JayRad11 closed 6 years ago
Do you have git installed?
Can you try composer install --no-dev --prefer-dist
Thanks again @snipe I just finished installing Git, as of 5mins ago.
I have run the composer install --no-dev --prefer-dist as requested, and have a return of...
c:\wamp\www\snipe-it>composer install --no-dev --prefer-dist Loading composer repositories with package information Installing dependencies from lock file Package operations: 28 installs, 0 updates, 0 removals
c:\wamp\www\snipe-it>
Can you advise my next action? Apologies for being such a newb with this update process. First time I've done it, but I'd like to use git pull in the future. :)
After updating to 4.1.4, everything seems to work but I can no longer add or clone any assets.(?)
When I fill out a new asset and click the green save button, the page seemingly "saves" but refreshes the page and clears all of the fields I filled out on said asset. I believe it is supposed to take me to the asset details page after I create a new asset if my memory serves me right?
I am not seeing any errors in the debug when this occurs..
@JayRad11 That usually means something is failing validation silently. Can you check your app log in storage/logs
, and also enable debug so that your debug bar is showing - check the requests tab there and see if there's anything of interest in the message bag.
I wrote up some docs on how the debugbar works here: https://snipe-it.readme.io/v4.0/docs/advanced-debugging
Thanks @snipe :)
I took a peak in the Requests tab but didn't find anything. I did however check the storage logs as you requested and found that there is a column unknown error. I'm not sure on how to proceed as I can't seem to find any "field list" table in the DB.
Next Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'location_id' in 'field list' (SQL: insert into assets
(model_id
, name
, serial
, company_id
, order_number
, notes
, asset_tag
, user_id
, archived
, physical
, depreciate
, status_id
, warranty_months
, purchase_cost
, purchase_date
, assigned_to
, supplier_id
, requestable
, rtd_location_id
, location_id
, image
, updated_at
, created_at
) values (120, Samsung Galaxy, , 1, , Andrew, 00376, 1, 0, 1, 0, 1, , , , , 1, 0, 1, 1, NuBWqmk2my5yHAEqVgcRgE9pH.jpeg, 2017-11-21 09:36:31, 2017-11-21 09:36:31)) in C:\wamp\www\snipe-it\vendor\laravel\framework\src\Illuminate\Database\Connection.php:647
Stack trace:
[2017-11-21 09:36:31] production.ERROR: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'location_id' in 'field list' in C:\wamp\www\snipe-it\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:77
Stack trace:
I'm wondering if maybe you haven't run migrations? location_id
in assets
was added a few versions ago. Try:
php artisan migrate
Oh, is the problem that I jumped to 4.1.4 straight from 4.0.10, or are the versions cumulative?
When I run php artisan migrate, I receive the following.
**c:\wamp\www\snipe-it>php artisan migrate
Application In Production! *
Do you really wish to run this command? (yes/no) [no]:
yes
[Illuminate\Database\QueryException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image'
(SQL: alter table categories
add image
varchar(191) null)
[Doctrine\DBAL\Driver\PDOException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image'
[PDOException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image'**
It shouldn't matter. There are special instructions on upgrading from v3 to v4, but as long as you mind the release notes on the point releases, you should be able to upgrade from 4.0 to 4.x pretty much at any point.
Can you show me the contents of your migrations
table? My guess is that something got hoarked somewhere during a migration so it didn't finish running.
Oh okay, sure thing!
I'm looking for the contents, not the structure :) select * from migrations
Oh Shoot! lol :P
+-----+--------------------------------------------------------------------------+-------+
| id | migration | batch |
+-----+--------------------------------------------------------------------------+-------+
| 1 | 2012_12_06_225921_migration_cartalyst_sentry_install_users | 1 |
| 2 | 2012_12_06_225929_migration_cartalyst_sentry_install_groups | 1 |
| 3 | 2012_12_06_225945_migration_cartalyst_sentry_install_users_groups_pivot | 1 |
| 4 | 2012_12_06_225988_migration_cartalyst_sentry_install_throttle | 1 |
| 5 | 2013_03_23_193214_update_users_table | 1 |
| 6 | 2013_11_13_075318_create_models_table | 1 |
| 7 | 2013_11_13_075335_create_categories_table | 1 |
| 8 | 2013_11_13_075347_create_manufacturers_table | 1 |
| 9 | 2013_11_15_015858_add_user_id_to_categories | 1 |
| 10 | 2013_11_15_112701_add_user_id_to_manufacturers | 1 |
| 11 | 2013_11_15_190327_create_assets_table | 1 |
| 12 | 2013_11_15_190357_create_licenses_table | 1 |
| 13 | 2013_11_15_201848_add_license_name_to_licenses | 1 |
| 14 | 2013_11_16_040323_create_depreciations_table | 1 |
| 15 | 2013_11_16_042851_add_depreciation_id_to_models | 1 |
| 16 | 2013_11_16_084923_add_user_id_to_models | 1 |
| 17 | 2013_11_16_103258_create_locations_table | 1 |
| 18 | 2013_11_16_103336_add_location_id_to_assets | 1 |
| 19 | 2013_11_16_103407_add_checkedout_to_to_assets | 1 |
| 20 | 2013_11_16_103425_create_history_table | 1 |
| 21 | 2013_11_17_054359_drop_licenses_table | 1 |
| 22 | 2013_11_17_054526_add_physical_to_assets | 1 |
| 23 | 2013_11_17_055126_create_settings_table | 1 |
| 24 | 2013_11_17_062634_add_license_to_assets | 1 |
| 25 | 2013_11_18_134332_add_contacts_to_users | 1 |
| 26 | 2013_11_18_142847_add_info_to_locations | 1 |
| 27 | 2013_11_18_152942_remove_location_id_from_asset | 1 |
| 28 | 2013_11_18_164423_set_nullvalues_for_user | 1 |
| 29 | 2013_11_19_013337_create_asset_logs_table | 1 |
| 30 | 2013_11_19_061409_edit_added_on_asset_logs_table | 1 |
| 31 | 2013_11_19_062250_edit_location_id_asset_logs_table | 1 |
| 32 | 2013_11_20_055822_add_soft_delete_on_assets | 1 |
| 33 | 2013_11_20_121404_add_soft_delete_on_locations | 1 |
| 34 | 2013_11_20_123137_add_soft_delete_on_manufacturers | 1 |
| 35 | 2013_11_20_123725_add_soft_delete_on_categories | 1 |
| 36 | 2013_11_20_130248_create_status_labels | 1 |
| 37 | 2013_11_20_130830_add_status_id_on_assets_table | 1 |
| 38 | 2013_11_20_131544_add_status_type_on_status_labels | 1 |
| 39 | 2013_11_20_134103_add_archived_to_assets | 1 |
| 40 | 2013_11_21_002321_add_uploads_table | 1 |
| 41 | 2013_11_21_024531_remove_deployable_boolean_from_status_labels | 1 |
| 42 | 2013_11_22_075308_add_option_label_to_settings_table | 1 |
| 43 | 2013_11_22_213400_edits_to_settings_table | 1 |
| 44 | 2013_11_25_013244_create_licenses_table | 1 |
| 45 | 2013_11_25_031458_create_license_seats_table | 1 |
| 46 | 2013_11_25_032022_add_type_to_actionlog_table | 1 |
| 47 | 2013_11_25_033008_delete_bad_licenses_table | 1 |
| 48 | 2013_11_25_033131_create_new_licenses_table | 1 |
| 49 | 2013_11_25_033534_add_licensed_to_licenses_table | 1 |
| 50 | 2013_11_25_101308_add_warrantee_to_assets_table | 1 |
| 51 | 2013_11_25_104343_alter_warranty_column_on_assets | 1 |
| 52 | 2013_11_25_150450_drop_parent_from_categories | 1 |
| 53 | 2013_11_25_151920_add_depreciate_to_assets | 1 |
| 54 | 2013_11_25_152903_add_depreciate_to_licenses_table | 1 |
| 55 | 2013_11_26_211820_drop_license_from_assets_table | 1 |
| 56 | 2013_11_27_062510_add_note_to_asset_logs_table | 1 |
| 57 | 2013_12_01_113426_add_filename_to_asset_log | 1 |
| 58 | 2013_12_06_094618_add_nullable_to_licenses_table | 1 |
| 59 | 2013_12_10_084038_add_eol_on_models_table | 1 |
| 60 | 2013_12_12_055218_add_manager_to_users_table | 1 |
| 61 | 2014_01_28_031200_add_qr_code_to_settings_table | 1 |
| 62 | 2014_02_13_183016_add_qr_text_to_settings_table | 1 |
| 63 | 2014_05_24_093839_alter_default_license_depreciation_id | 1 |
| 64 | 2014_05_27_231658_alter_default_values_licenses | 1 |
| 65 | 2014_06_19_191508_add_asset_name_to_settings | 1 |
| 66 | 2014_06_20_004847_make_asset_log_checkedout_to_nullable | 1 |
| 67 | 2014_06_20_005050_make_asset_log_purchasedate_to_nullable | 1 |
| 68 | 2014_06_24_003011_add_suppliers | 1 |
| 69 | 2014_06_24_010742_add_supplier_id_to_asset | 1 |
| 70 | 2014_06_24_012839_add_zip_to_supplier | 1 |
| 71 | 2014_06_24_033908_add_url_to_supplier | 1 |
| 72 | 2014_07_08_054116_add_employee_id_to_users | 1 |
| 73 | 2014_07_09_134316_add_requestable_to_assets | 1 |
| 74 | 2014_07_17_085822_add_asset_to_software | 1 |
| 75 | 2014_07_17_161625_make_asset_id_in_logs_nullable | 1 |
| 76 | 2014_08_12_053504_alpha_0_4_2_release | 1 |
| 77 | 2014_08_17_083523_make_location_id_nullable | 1 |
| 78 | 2014_10_16_200626_add_rtd_location_to_assets | 1 |
| 79 | 2014_10_24_000417_alter_supplier_state_to_32 | 1 |
| 80 | 2014_10_24_015641_add_display_checkout_date | 1 |
| 81 | 2014_10_28_222654_add_avatar_field_to_users_table | 1 |
| 82 | 2014_10_29_045924_add_image_field_to_models_table | 1 |
| 83 | 2014_11_01_214955_add_eol_display_to_settings | 1 |
| 84 | 2014_11_04_231416_update_group_field_for_reporting | 1 |
| 85 | 2014_11_05_212408_add_fields_to_licenses | 1 |
| 86 | 2014_11_07_021042_add_image_to_supplier | 1 |
| 87 | 2014_11_20_203007_add_username_to_user | 1 |
| 88 | 2014_11_20_223947_add_auto_to_settings | 1 |
| 89 | 2014_11_20_224421_add_prefix_to_settings | 1 |
| 90 | 2014_11_21_104401_change_licence_type | 1 |
| 91 | 2014_12_09_082500_add_fields_maintained_term_to_licenses | 1 |
| 92 | 2015_02_04_155757_increase_user_field_lengths | 1 |
| 93 | 2015_02_07_013537_add_soft_deleted_to_log | 1 |
| 94 | 2015_02_10_040958_fix_bad_assigned_to_ids | 1 |
| 95 | 2015_02_10_053310_migrate_data_to_new_statuses | 1 |
| 96 | 2015_02_11_044104_migrate_make_license_assigned_null | 1 |
| 97 | 2015_02_11_104406_migrate_create_requests_table | 1 |
| 98 | 2015_02_12_001312_add_mac_address_to_asset | 1 |
| 99 | 2015_02_12_024100_change_license_notes_type | 1 |
| 100 | 2015_02_17_231020_add_localonly_to_settings | 1 |
| 101 | 2015_02_19_222322_add_logo_and_colors_to_settings | 1 |
| 102 | 2015_02_24_072043_add_alerts_to_settings | 1 |
| 103 | 2015_02_25_022931_add_eula_fields | 1 |
| 104 | 2015_02_25_204513_add_accessories_table | 1 |
| 105 | 2015_02_26_091228_add_accessories_user_table | 1 |
| 106 | 2015_02_26_115128_add_deleted_at_models | 1 |
| 107 | 2015_02_26_233005_add_category_type | 1 |
| 108 | 2015_03_01_231912_update_accepted_at_to_acceptance_id | 1 |
| 109 | 2015_03_05_011929_add_qr_type_to_settings | 1 |
| 110 | 2015_03_18_055327_add_note_to_user | 1 |
| 111 | 2015_04_29_234704_add_slack_to_settings | 1 |
| 112 | 2015_05_04_085151_add_parent_id_to_locations_table | 1 |
| 113 | 2015_05_22_124421_add_reassignable_to_licenses | 1 |
| 114 | 2015_06_10_003314_fix_default_for_user_notes | 1 |
| 115 | 2015_06_10_003554_create_consumables | 1 |
| 116 | 2015_06_15_183253_move_email_to_username | 1 |
| 117 | 2015_06_23_070346_make_email_nullable | 1 |
| 118 | 2015_06_26_213716_create_asset_maintenances_table | 1 |
| 119 | 2015_07_04_212443_create_custom_fields_table | 1 |
| 120 | 2015_07_09_014359_add_currency_to_settings_and_locations | 1 |
| 121 | 2015_07_21_122022_add_expected_checkin_date_to_asset_logs | 1 |
| 122 | 2015_07_24_093845_add_checkin_email_to_category_table | 1 |
| 123 | 2015_07_25_055415_remove_email_unique_constraint | 1 |
| 124 | 2015_07_29_230054_add_thread_id_to_asset_logs_table | 1 |
| 125 | 2015_07_31_015430_add_accepted_to_assets | 1 |
| 126 | 2015_09_09_195301_add_custom_css_to_settings | 1 |
| 127 | 2015_09_21_235926_create_custom_field_custom_fieldset | 1 |
| 128 | 2015_09_22_000104_create_custom_fieldsets | 1 |
| 129 | 2015_09_22_003321_add_fieldset_id_to_assets | 1 |
| 130 | 2015_09_22_003413_migrate_mac_address | 1 |
| 131 | 2015_09_28_003314_fix_default_purchase_order | 1 |
| 132 | 2015_10_01_024551_add_accessory_consumable_price_info | 1 |
| 133 | 2015_10_12_192706_add_brand_to_settings | 1 |
| 134 | 2015_10_22_003314_fix_defaults_accessories | 1 |
| 135 | 2015_10_23_182625_add_checkout_time_and_expected_checkout_date_to_assets | 1 |
| 136 | 2015_11_05_061015_create_companies_table | 1 |
| 137 | 2015_11_05_061115_add_company_id_to_consumables_table | 1 |
| 138 | 2015_11_05_183749_image | 1 |
| 139 | 2015_11_06_092038_add_company_id_to_accessories_table | 1 |
| 140 | 2015_11_06_100045_add_company_id_to_users_table | 1 |
| 141 | 2015_11_06_134742_add_company_id_to_licenses_table | 1 |
| 142 | 2015_11_08_035832_add_company_id_to_assets_table | 1 |
| 143 | 2015_11_08_222305_add_ldap_fields_to_settings | 1 |
| 144 | 2015_11_15_151803_add_full_multiple_companies_support_to_settings_table | 1 |
| 145 | 2015_11_26_195528_import_ldap_settings | 1 |
| 146 | 2015_11_30_191504_remove_fk_company_id | 1 |
| 147 | 2015_12_21_193006_add_ldap_server_cert_ignore_to_settings_table | 1 |
| 148 | 2015_12_30_233509_add_timestamp_and_userId_to_custom_fields | 1 |
| 149 | 2015_12_30_233658_add_timestamp_and_userId_to_custom_fieldsets | 1 |
| 150 | 2016_01_28_041048_add_notes_to_models | 1 |
| 151 | 2016_02_19_070119_add_remember_token_to_users_table | 1 |
| 152 | 2016_02_19_073625_create_password_resets_table | 1 |
| 153 | 2016_03_02_193043_add_ldap_flag_to_users | 1 |
| 154 | 2016_03_02_220517_update_ldap_filter_to_longer_field | 1 |
| 155 | 2016_03_08_225351_create_components_table | 1 |
| 156 | 2016_03_09_024038_add_min_stock_to_tables | 1 |
| 157 | 2016_03_10_133849_add_locale_to_users | 1 |
| 158 | 2016_03_10_135519_add_locale_to_settings | 1 |
| 159 | 2016_03_11_185621_add_label_settings_to_settings | 1 |
| 160 | 2016_03_22_125911_fix_custom_fields_regexes | 1 |
| 161 | 2016_04_28_141554_add_show_to_users | 1 |
| 162 | 2016_05_16_164733_add_model_mfg_to_consumable | 1 |
| 163 | 2016_05_19_180351_add_alt_barcode_settings | 1 |
| 164 | 2016_05_19_191146_add_alter_interval | 1 |
| 165 | 2016_05_19_192226_add_inventory_threshold | 1 |
| 166 | 2016_05_20_024859_remove_option_keys_from_settings_table | 1 |
| 167 | 2016_05_20_143758_remove_option_value_from_settings_table | 1 |
| 168 | 2016_06_01_140218_add_email_domain_and_format_to_settings | 1 |
| 169 | 2016_06_22_160725_add_user_id_to_maintenances | 1 |
| 170 | 2016_07_13_150015_add_is_ad_to_settings | 1 |
| 171 | 2016_07_14_153609_add_ad_domain_to_settings | 1 |
| 172 | 2016_07_22_003348_fix_custom_fields_regex_stuff | 1 |
| 173 | 2016_07_22_054850_one_more_mac_addr_fix | 1 |
| 174 | 2016_07_22_143045_add_port_to_ldap_settings | 1 |
| 175 | 2016_07_22_153432_add_tls_to_ldap_settings | 1 |
| 176 | 2016_07_27_211034_add_zerofill_to_settings | 1 |
| 177 | 2016_08_02_124944_add_color_to_statuslabel | 1 |
| 178 | 2016_08_04_134500_add_disallow_ldap_pw_sync_to_settings | 1 |
| 179 | 2016_08_09_002225_add_manufacturer_to_licenses | 1 |
| 180 | 2016_08_12_121613_add_manufacturer_to_accessories_table | 1 |
| 181 | 2016_08_23_143353_add_new_fields_to_custom_fields | 1 |
| 182 | 2016_08_23_145619_add_show_in_nav_to_status_labels | 1 |
| 183 | 2016_08_30_084634_make_purchase_cost_nullable | 1 |
| 184 | 2016_09_01_141051_add_requestable_to_asset_model | 1 |
| 185 | 2016_09_02_001448_create_checkout_requests_table | 1 |
| 186 | 2016_09_04_180400_create_actionlog_table | 1 |
| 187 | 2016_09_04_182149_migrate_asset_log_to_action_log | 1 |
| 188 | 2016_09_19_235935_fix_fieldtype_for_target_type | 1 |
| 189 | 2016_09_23_140722_fix_modelno_in_consumables_to_string | 1 |
| 190 | 2016_09_28_231359_add_company_to_logs | 1 |
| 191 | 2016_10_14_130709_fix_order_number_to_varchar | 1 |
| 192 | 2016_10_16_015024_rename_modelno_to_model_number | 1 |
| 193 | 2016_10_16_015211_rename_consumable_modelno_to_model_number | 1 |
| 194 | 2016_10_16_143235_rename_model_note_to_notes | 1 |
| 195 | 2016_10_16_165052_rename_component_total_qty_to_qty | 1 |
| 196 | 2016_10_19_145520_fix_order_number_in_components_to_string | 1 |
| 197 | 2016_10_27_151715_add_serial_to_components | 1 |
| 198 | 2016_10_27_213251_increase_serial_field_capacity | 1 |
| 199 | 2016_10_29_002724_enable_2fa_fields | 1 |
| 200 | 2016_10_29_082408_add_signature_to_acceptance | 1 |
| 201 | 2016_11_01_030818_fix_forgotten_filename_in_action_logs | 1 |
| 202 | 2016_11_13_020954_rename_component_serial_number_to_serial | 1 |
| 203 | 2016_11_16_172119_increase_purchase_cost_size | 1 |
| 204 | 2016_11_17_161317_longer_state_field_in_location | 1 |
| 205 | 2016_11_17_193706_add_model_number_to_accessories | 1 |
| 206 | 2016_11_24_160405_add_missing_target_type_to_logs_table | 1 |
| 207 | 2016_12_07_173720_increase_size_of_state_in_suppliers | 1 |
| 208 | 2016_12_19_004212_adjust_locale_length_to_10 | 1 |
| 209 | 2016_12_19_133936_extend_phone_lengths_in_supplier_and_elsewhere | 1 |
| 210 | 2016_12_27_212631_make_asset_assigned_to_polymorphic | 1 |
| 211 | 2017_01_09_040429_create_locations_ldap_query_field | 1 |
| 212 | 2017_01_14_002418_create_imports_table | 1 |
| 213 | 2017_01_25_063357_fix_utf8_custom_field_column_names | 1 |
| 214 | 2017_03_03_154632_add_time_date_display_to_settings | 1 |
| 215 | 2017_03_10_210807_add_fields_to_manufacturer | 1 |
| 216 | 2017_05_08_195520_increase_size_of_field_values_in_custom_fields | 1 |
| 217 | 2017_05_22_204422_create_departments | 1 |
| 218 | 2017_05_22_233509_add_manager_to_locations_table | 1 |
| 219 | 2017_06_14_122059_add_next_autoincrement_to_settings | 1 |
| 220 | 2017_06_18_151753_add_header_and_first_row_to_importer_table | 1 |
| 221 | 2017_07_07_191533_add_login_text | 1 |
| 222 | 2017_07_25_130710_add_thumbsize_to_settings | 1 |
| 223 | 2017_08_03_160105_set_asset_archived_to_zero_default | 1 |
| 224 | 2017_08_22_180636_add_secure_password_options | 1 |
| 225 | 2017_08_25_074822_add_auditing_tables | 1 |
| 226 | 2017_08_25_101435_add_auditing_to_settings | 1 |
| 227 | 2017_09_18_225619_fix_assigned_type_not_being_nulled | 1 |
| 228 | 2017_10_03_015503_drop_foreign_keys | 1 |
| 229 | 2017_10_10_123504_allow_nullable_depreciation_id_in_models | 1 |
| 230 | 2016_06_01_000001_create_oauth_auth_codes_table | 2 |
| 231 | 2016_06_01_000002_create_oauth_access_tokens_table | 2 |
| 232 | 2016_06_01_000003_create_oauth_refresh_tokens_table | 2 |
| 233 | 2016_06_01_000004_create_oauth_clients_table | 2 |
| 234 | 2016_06_01_000005_create_oauth_personal_access_clients_table | 2 |
| 235 | 2017_10_17_133709_add_display_url_to_settings | 2 |
| 236 | 2017_10_19_120002_add_custom_forgot_password_url | 2 |
| 237 | 2017_10_19_130406_add_image_and_supplier_to_accessories | 2 |
| 238 | 2017_10_20_234129_add_location_indices_to_assets | 2 |
+-----+--------------------------------------------------------------------------+-------+
Okay, I'm going to bet that something got hoarked in the 2017_10_25_202930_add_images_uploads_to_locations_manufacturers_etc
, so let's check that it actually seems to have run, and then we'll insert the record in the migrations table to trick it into skipping it.
Check the following tables and confirm that you have a column called image
on ALL of them:
If you do, great! If not, let me know and we'll work through it. If you DO, try running this SQL command:
INSERT INTO migrations (migration, batch) VALUES ('2017_10_25_202930_add_images_uploads_to_locations_manufacturers_etc', '2');
And then try php artisan migrate
again.
I really appreciate the help @snipe . :)
Okay, so I checked those tables and found that Components, Consumables, Departments, and Manufacturers do not have an "image" column like the rest.
Sorry for the delay. I'm honestly not sure what could have gone wrong here, but let's try this....
Open up database/migrations/2017_10_25_202930_add_images_uploads_to_locations_manufacturers_etc.php
in a text editor and comment out the Schema:: bit related to categories.
Schema::table('categories', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('companies', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('components', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('consumables', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('departments', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('locations', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('manufacturers', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Should now be:
// Schema::table('categories', function (Blueprint $table) {
// $table->string('image')->nullable()->default(null);
// });
Schema::table('companies', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('components', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('consumables', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('departments', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('locations', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
Schema::table('manufacturers', function (Blueprint $table) {
$table->string('image')->nullable()->default(null);
});
then try running migrations again.
You should normally never have to do this, so not sure what happened, but it's fixable, even if it's weird.
Hey @snipe , no worries! I was away all last week on some SQL training; so my apologies for MY delay!
I have run the migration after commenting out those three lines. I received the same return value as before after confiming the migration (See below). My logs still seem to cough up the production.ERROR: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'location_id' in 'field list' in C:\wamp\www\snipe-it\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:77
Application In Production! *
Do you really wish to run this command? (yes/no) [no]:
yes
[Illuminate\Database\QueryException]
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image'
(SQL: alter table companies
add image
varchar(191) null)
[Doctrine\DBAL\Driver\PDOException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image'
[PDOException] SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'image'
And those columns DO exist now?
Ah, I should have checked that.
No, I am not seeing any image columns in the Components, Consumables, Departments, or Manufacturers tables.
Okay, that legit doesn't make sense then. The migration thinks those columns exist. Is it possible you've got two different databases, and you're looking at the wrong one?
I have another database located in the www folder, which is the old snipe-it environment that was backed up before performing the recent upgrade. But it's folder was renamed to "snipe-it backup", so I don't think that it could interfere?
I decided to create those image columns manually for each table, and then ran the INSERT INTO migrations (migration, batch) VALUES ('2017_10_25_202930_add_images_uploads_to_locations_manufacturers_etc', '2');
Afterwards I ran the migration again, which finally returned something positive.
c:\wamp\www\snipe-it>php artisan migrate
Application In Production! *
Do you really wish to run this command? (yes/no) [no]:
yes
Migrating: 2017_10_27_180947_denorm_asset_locations Migrated: 2017_10_27_180947_denorm_asset_locations Migrating: 2017_10_27_192423_migrate_denormed_asset_locations Migrated: 2017_10_27_192423_migrate_denormed_asset_locations Migrating: 2017_10_30_182938_add_address_to_user Migrated: 2017_10_30_182938_add_address_to_user Migrating: 2017_11_08_025918_add_alert_menu_setting Migrated: 2017_11_08_025918_add_alert_menu_setting Migrating: 2017_11_08_123942_labels_display_company_name Migrated: 2017_11_08_123942_labels_display_company_name
I logged into the snipe-it front end and tested the creation of an asset, which now works!
Your database reference doesn’t care what directory you’re in - when you run migrations, whatever database is referenced in your .env is the one that’s will be affected.
I still don’t really understand what happened here, but I suspect you might have been running this against the wrong DB at some point. I’m glad you got it sorted though. Going to close this ticket for now. :)
Expected Behavior (or desired behavior if a feature request)
Following upgrade documentation and upgrading from 4.0.1 to 4.1.4.
Actual Behavior
After running composer install --no-dev --prefer-source I receive the following error loop.
Please confirm you have done the following before posting your bug report:
Provide answers to these questions:
Is this a fresh install or an upgrade? Fresh Version of Snipe-IT you're running snipe-it-4.0.10 Version of PHP you're running php 7.1.9 Version of MySQL/MariaDB you're running 5.7.19 What OS and web server you're running Snipe-IT on Windows Server 2012 / WAMP What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) Manual Installation If you're getting an error in your browser, include that error None What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error None If a stacktrace is provided in the error, include that too. None Any errors that appear in your browser's error console. None Confirm whether the error is reproduceable on the demo. None Include any additional information you can find in app/storage/logs and your webserver's logs. None Include what you've done so far in the installation, and if you got any error messages along the way. So far I have only added assets to the database and have been populating all relevant fields. (Adding Models, Pictures, Owners, Locations, etc)
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
https://snipe-it.readme.io/docs/getting-help