Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aircraft Importer, Empty FIN field causes problems #1650

Closed
FatihKoz opened this issue Oct 23, 2023 · 0 comments · Fixed by #1649
Closed

Aircraft Importer, Empty FIN field causes problems #1650

FatihKoz opened this issue Oct 23, 2023 · 0 comments · Fixed by #1649

Comments

@FatihKoz
Copy link
Contributor

While importing aircraft, empty fin field causes sql integrity constraint violation error.

Version
7.0.0-dev+231022.d69a3b

To Reproduce
Steps to reproduce the behavior:

  1. Export some of your aircraft (not subfleet)
  2. Check the fin fields in the csv, they should be empty
  3. Import the file back
  4. See error

Expected behavior
Empty fields should not cause unique checks to fail and model should not return empty strings, they should return null

Additional context
Example aircraft.csv

subfleet,iata,icao,hub_id,airport_id,name,registration,fin,hex_code,mtow,zfw,status
A20N-AJET,20N,A20N,,LTFJ,TC-LUK,TC-LUK,,,79000,,A
A20N-AJET,20N,A20N,,LTFJ,TC-LUL,TC-LUL,,,79000,,A
A20N-AJET,20N,A20N,,LTCG,TC-LUN,TC-LUN,,,79000,,A
A20N-AJET,20N,A20N,LTAC,LTBJ,TC-LUO,TC-LUO,,,79000,,A
A20N-AJET,20N,A20N,LTAC,LTAC,TC-LUV,TC-LUV,,,79000,,A
A20N-AJET,20N,A20N,LTAC,LTAC,TC-LUY,TC-LUY,,,79000,,A
A20N-AJET,20N,A20N,LTAC,LTAC,TC-LUZ,TC-LUZ,,,79000,,A

Import result

Error in row 3: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'aircraft_fin_unique' (Connection: mysql, SQL: update `aircraft` set `hub_id` = , `fin` = , `hex_code` = 4df98ce6, `zfw` = , `aircraft`.`updated_at` = 2023-10-23 17:38:55 where `id` = 827)
Error in row 4: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'aircraft_fin_unique' (Connection: mysql, SQL: update `aircraft` set `hub_id` = , `fin` = , `hex_code` = 4cb04e1e, `zfw` = , `aircraft`.`updated_at` = 2023-10-23 17:38:55 where `id` = 828)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant