create a google apps script to prompt for a csv file to import, and add it as a new sheet to the current document.
The imported file contains 4 columns: table_name, column_name, data_type, is_nullable.
replace if the same named sheet exists
add to the script
Insert 6 columns to the left: Fields audited, Change title of table, Audit, Django created Table, Django created field, Django app name. Do not do the initial import from column 7, since the insert will move the data over.
Insert a column to the right of table_name and before column_name: table_name-prefix. The values should be '=RIGHT(G269, LEN(G269) - FIND("_", G269))'
make the header text bold
make all header rows into 3 lines to make the columns narrower
format columns A-E into checkboxes
create a custom menu to call it
add to the script
Column F values should use the formula =LEFT(G11, FIND("_", G11) - 1)
Column E values should use the formula =IF(OR(I12="id", I12="uuid", I12="created_at", I12="updated_at"), TRUE, FALSE)
Column D values should be FALSE if Django app name is "core" or "project", otherwise TRUE
add filter to column D to hide if TRUE
hide columns F,G
fill columns D,E,H-K with light gray 2
Overview
We need to automate importing the latest table-descriptions from the Django app since it is a repeating process. We should use Apps Script since the audit spreadsheet is on Google spreadsheet.
Action Items
Resources/Instructions
Requirements from the spreadsheet
Some prompts to get started
Working code running in the spreadsheet