doc: explain distributors

This commit is contained in:
King Kévin 2023-01-28 06:23:55 +01:00
parent 9894c27498
commit f1f79b9630
2 changed files with 48 additions and 0 deletions

View File

@ -7,6 +7,10 @@ Once the service is installed, there is a single page to search, add, delete, or
The only aspect not handled by the web frontend is the attachments. The only aspect not handled by the web frontend is the attachments.
Just add the files directly on the server under `public/attachments/<part_name>/`. Just add the files directly on the server under `public/attachments/<part_name>/`.
Distributors also need to be managed directly in the database.
Since this does change very often, it isn't too much of a hassle.
An example is in `populate.sql`, also with some other entries.
goals goals
===== =====

44
populate.sql Normal file
View File

@ -0,0 +1,44 @@
-- manufacturers
INSERT INTO manufacturer (name, homepage, search) VALUES ("Espressif", "https://www.espressif.com/", "https://products.espressif.com/#/product-selector");
-- packages
INSERT INTO package (name) VALUES ("module");
-- distributors
INSERT INTO distributor (name, homepage, product_page) VALUES ("LCSC", "https://www.lcsc.com/", "https://www.lcsc.com/product-detail/%s.html");
INSERT INTO distributor (name, homepage, product_page) VALUES ("JLCPCB", "https://jlcpcb.com/", "https://jlcpcb.com/partdetail/part/%s");
INSERT INTO distributor (name, homepage, product_page) VALUES ("DigiKey", "https://www.digikey.com/en", "https://www.digikey.com/products/en?keywords=%s");
INSERT INTO distributor (name, homepage, product_page) VALUES ("Mouser", "https://eu.mouser.com/", "https://eu.mouser.com/Search/Refine?Keyword=%s");
INSERT INTO distributor (name, homepage, product_page) VALUES ("Octopart", "https://octopart.com/", "https://octopart.com/%s");
INSERT INTO distributor (name, homepage, product_page) VALUES ("AliExpress", "https://www.aliexpress.com/", "https://aliexpress.com/item/%s.html");
-- parts
INSERT INTO part (name, description, manufacturer, datasheet, package, pincount, page) VALUES ("ESP32-S3-WROOM-1", "ESP32-S3 module, PCB antenna", (SELECT id FROM manufacturer WHERE name = "Espressif"), "https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf", (SELECT id FROM package WHERE name = "module"), 49, "https://www.espressif.com/en/module/esp32-s3-wroom-1-en");
INSERT INTO part (name, description) VALUES ("ESP32-S3-WROOM-1-N4", "ESP32-S3 module, PCB antenna, 4MB flash");
UPDATE part SET family=(SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1") WHERE name = "ESP32-S3-WROOM-1-N4";
-- distribution
INSERT INTO distribution (part, distributor, sku) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1-N4"), (SELECT id FROM distributor WHERE name = "LCSC"), "C2913197");
INSERT INTO distribution (part, distributor, sku) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1-N4"), (SELECT id FROM distributor WHERE name = "Mouser"), "356-ESP32-S3WROOM1N4");
-- locations
INSERT INTO location (name, container) VALUES ("MCU-ice", "ice");
INSERT INTO location (name, container) VALUES ("RF-ice", "ice");
-- stock
INSERT INTO inventory (part, location, quantity) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1-N4"), (SELECT id FROM location WHERE name = "MCU-ice"), 1);
INSERT INTO inventory (part, location, quantity) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1-N4"), (SELECT id FROM location WHERE name = "RF-ice"), 2);
-- create some properties
INSERT INTO property (name) VALUES ("category");
INSERT INTO property (name) VALUES ("qeda_path");
INSERT INTO property (name) VALUES ("qeda_variant");
INSERT INTO property (name) VALUES ("kicad_symbol");
INSERT INTO property (name) VALUES ("kicad_footprint");
INSERT INTO property (name) VALUES ("JLCPCB_CORRECTION");
-- set properties
INSERT INTO property_value (part, property, value) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1"), (SELECT id FROM property WHERE name = "category"), "MCU");
INSERT INTO property_value (part, property, value) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1"), (SELECT id FROM property WHERE name = "category"), "RF");
INSERT INTO property_value (part, property, value) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1"), (SELECT id FROM property WHERE name = "category"), "WiFi");
INSERT INTO property_value (part, property, value) VALUES ((SELECT id FROM part WHERE name = "ESP32-S3-WROOM-1"), (SELECT id FROM property WHERE name = "category"), "Bluetooth");