Moved SQL to a file
This commit is contained in:
58
README.md
58
README.md
@@ -23,60 +23,8 @@ each product you want to use this module with.
|
|||||||
| Initial Operating System | Text Box | Set to whatever you want | Leave Blank | Leave Blank | :x: | :x: | :white_check_mark: | :x: |
|
| Initial Operating System | Text Box | Set to whatever you want | Leave Blank | Leave Blank | :x: | :x: | :white_check_mark: | :x: |
|
||||||
| Initial SSH Key | Text Box | Set to whatever you want | Leave Blank | Leave Blank | :x: | :x: | :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:
|
You can run this SQL query to create the custom fields. Run the SQL from this [file](modify.sql) or copy the contents
|
||||||
|
from it.
|
||||||
```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?
|
## What does this module change?
|
||||||
|
|
||||||
@@ -87,4 +35,4 @@ This module changes the following things:
|
|||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [ ] Add post checkout checks to ensure the user has selected an operating system and added a ssh key.
|
- [ ] Add post checkout checks to ensure the user has selected an operating system and added a ssh key.
|
||||||
|
|||||||
49
modify.sql
Normal file
49
modify.sql
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
-- 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);
|
||||||
Reference in New Issue
Block a user