CREATE VIEW "code_notebook_cell_versions" AS
-- code provenance: `RssdInitSqlNotebook.notebookBusinessLogicViews` (file:///home/baasit/www.surveilr.com/lib/std/lifecycle.sql.ts)
-- All cells and how many different versions of each cell are available
SELECT notebook_name,
notebook_kernel_id,
cell_name,
COUNT(*) OVER(PARTITION BY notebook_name, cell_name) AS versions,
code_notebook_cell_id
FROM code_notebook_cell
ORDER BY notebook_name, cell_name