CREATE VIEW "code_notebook_sql_cell_migratable_not_executed" AS
-- code provenance: `RssdInitSqlNotebook.notebookBusinessLogicViews` (file:///home/baasit/www.surveilr.com/lib/std/lifecycle.sql.ts)
-- All latest migratable cells that have not yet been "executed" (based on the code_notebook_state table)
SELECT c.*
FROM code_notebook_sql_cell_migratable c
LEFT JOIN code_notebook_state s
ON c.code_notebook_cell_id = s.code_notebook_cell_id AND s.to_state = 'EXECUTED'
WHERE s.code_notebook_cell_id IS NULL
ORDER BY c.cell_name