-
Notifications
You must be signed in to change notification settings - Fork 1
Bulk upload of device data
Occasionally we receive requests for bulk uploads of data from for example a spreadsheet of data. We do not currently have a bulk upload feature, however if you are able to provide the device information to us as a SQL script of INSERT statements, we can add this data for you.
I guess I'd need to create INSERTs for events and devices. Alternatively, I could create events manually, get the events ids somehow and then add devices with the SQL script.
It has to be the latter - the events need to be created manually via the Fixometer interface, as this triggers their creation in our Wordpress front-end website. If we just inserted into the DB they wouldn't appear on the public website. You can get the IDs from the URL that you see when you are editing a particular party in the interface - e.g. https://community.therestartproject.org/party/manage/42
Have a look at: https://github.com/TheRestartProject/Fixometer/blob/master/data/migrations/00001-InitialiseDB.sql . Some further details are below.
'category' and 'category_creation' are IDs provided by you?
Category ids are below. category_creation refers to category revisions however it is not currently being used. The category_creation value is currently always the same as the category id.
- 11,Desktop computer
- 12,Flat screen 15-17"
- 13,Flat screen 19-20"
- 14,Flat screen 22-24"
- 15,Laptop large
- 16,Laptop medium
- 17,Laptop small
- 18,Paper shredder
- 19,PC Accessory
- 20,Printer/scanner
- 21,Digital Compact Camera
- 22,DLSR / Video Camera
- 23,Handheld entertainment device
- 24,Headphones
- 25,Mobile
- 26,Tablet
- 27,Flat screen 26-30"
- 28,Flat screen 32-37"
- 29,Hi-Fi integrated
- 30,Hi-Fi separates
- 31,Musical instrument
- 32,Portable radio
- 33,Projector
- 34,TV and gaming-related accessories
- 35,Aircon/Dehumidifier
- 36,Decorative or safety lights
- 37,Fan
- 38,Hair & Beauty item
- 39,Kettle
- 40,Lamp
- 41,Power tool
- 42,Small kitchen item
- 43,Toaster
- 44,Toy
- 45,Vacuum
- 46,Misc
What is 'estimate' for?
Estimate is for when the category is not known (in the interface, when you select 'None of the above', which is 46 - Misc in the DB). This is the estimated weight in kilos.
spare_parts, repair_status, professional_help, more_time_needed, do_it_yourself are all status codes, right?
spare_parts
- 1 = yes
- 2 = no
repair_status
- 1 = fixed
- 2 = repairable
- 3 = end-of-life
professional_help, more_time_needed, do_it_yourself
These are mutually exclusive options, one of which should be selected if and only if repair_status = repairable
- 0 = no
- 1 = yes
'repaired_by' is a reference to a user? can we use a dummy user for all devices?
Correct. This isn't currently being used in the interface, and the dummy user you should set it to is 29.
what is the 'timestamp' format?
e.g. 2017-06-16 19:19:01