CREATE TABLE "code_notebook_cell" (
"code_notebook_cell_id" VARCHAR PRIMARY KEY NOT NULL,
"notebook_kernel_id" VARCHAR NOT NULL,
"notebook_name" TEXT NOT NULL,
"cell_name" TEXT NOT NULL,
"cell_governance" TEXT CHECK(json_valid(cell_governance) OR cell_governance IS NULL),
"interpretable_code" TEXT NOT NULL,
"interpretable_code_hash" TEXT NOT NULL,
"description" TEXT,
"arguments" TEXT CHECK(json_valid(arguments) OR arguments IS NULL),
"created_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
"created_by" TEXT DEFAULT 'UNKNOWN',
"updated_at" TIMESTAMPTZ,
"updated_by" TEXT,
"deleted_at" TIMESTAMPTZ,
"deleted_by" TEXT,
"activity_log" TEXT,
FOREIGN KEY("notebook_kernel_id") REFERENCES "code_notebook_kernel"("code_notebook_kernel_id"),
UNIQUE("notebook_name", "cell_name", "interpretable_code_hash")
)