From c6012fa63c98a53da96804a265ae6bf51456a5dc Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 10 Sep 2023 23:46:43 -0400 Subject: [PATCH] Updated readme.me --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index 32fe592..8d71ae4 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,61 @@ each product you want to use this module with. | Initial Operating System | Text Box | Set to whatever you want | Leave Blank | Leave Blank | :x: | :white_check_mark: | :white_check_mark: | :x: | | Initial SSH Key | Text Box | Set to whatever you want | Leave Blank | Leave Blank | :x: | :x: | :white_check_mark: | :x: | +You can run this SQL query to create the custom fields: + +```sql +-- Insert records for Initial Operating System if they don't already exist +INSERT INTO tblcustomfields +(type, relid, fieldname, fieldtype, description, fieldoptions, regexpr, adminonly, required, showorder, showinvoice, + sortorder, created_at, updated_at) +SELECT 'product', + id, + 'Initial Operating System', + 'text', + '', + '', + '', + '', + 'on', + '', + '', + 0, + UTC_TIMESTAMP(), + UTC_TIMESTAMP() +FROM tblproducts +WHERE servertype = 'VirtFusionDirect' + AND NOT EXISTS (SELECT 1 + FROM tblcustomfields + WHERE fieldname = 'Initial Operating System' + AND relid = tblproducts.id); + +-- Insert records for Initial SSH Key if they don't already exist +INSERT INTO tblcustomfields +(type, relid, fieldname, fieldtype, description, fieldoptions, regexpr, adminonly, required, showorder, showinvoice, + sortorder, created_at, updated_at) +SELECT 'product', + id, + 'Initial SSH Key', + 'text', + '', + '', + '', + '', + 'on', + '', + '', + 0, + UTC_TIMESTAMP(), + UTC_TIMESTAMP() +FROM tblproducts +WHERE servertype = 'VirtFusionDirect' + AND NOT EXISTS (SELECT 1 + FROM tblcustomfields + WHERE fieldname = 'Initial SSH Key' + AND relid = tblproducts.id); +``` + + ## What does this module change? This module changes the following things: