fix(phys8): закрытие критических проблем ревью — миграции, ✓→✓, ConvectionSim

- Удалены legacy миграции 009/010/015 (создавали несуществующие physics-8-thermal/electro/optics)
- 037_physics_8_hub.sql сделана self-sufficient: INSERT OR IGNORE родителя + UPDATE
- 7 шт. literal ✓ заменены на ✓ в physics_8_lab.html (правило проекта)
- В phys.js добавлен createConvectionSim — главный визуал §4 (тороидальный поток частиц)
  закрытие плана Phase 0 Физики 8
This commit is contained in:
Maxim Dolgolyov
2026-05-30 09:44:51 +03:00
parent bf788c1c3a
commit 09cfaa3bd2
6 changed files with 98 additions and 66 deletions
@@ -1,19 +1,27 @@
-- Physics 8 hub migration.
-- Rebuilds physics-8 as a full 3-chapter + lab textbook in the style of physics-10:
-- Physics 8 hub migration (self-sufficient).
-- Creates / rebuilds physics-8 as a full 3-chapter + lab textbook in the style of physics-10:
-- physics-8 (hub, html_path = physics_8_hub.html)
-- physics-8-ch1 (Тепловые явления, §§1–11) → physics_8_ch1.html
-- physics-8-ch2 (Электромагнитные явления, §§1231) → physics_8_ch2.html
-- physics-8-ch3 (Световые явления, §§32–40) → physics_8_ch3.html
-- physics-8-lab (Лабораторный практикум, 7 ЛР) → physics_8_lab.html
--
-- Replaces the old legacy children created in migration 015
-- (physics-8-thermal / physics-8-electro / physics-8-optics), which pointed
-- to monolithic legacy files. Author left empty per project policy.
-- This migration is the single source of truth for physics-8 textbook structure.
-- It is idempotent and does not depend on any prior physics-8 migration.
-- 1. Remove legacy children (HTML files are kept on disk as backup, just unlinked from DB).
-- 1. Remove legacy children if they ever existed (no-op on fresh DBs).
DELETE FROM textbooks WHERE slug IN ('physics-8-thermal', 'physics-8-electro', 'physics-8-optics');
-- 2. Update the parent physics-8 hub row.
-- 2. Ensure the parent physics-8 hub row exists.
INSERT OR IGNORE INTO textbooks
(slug, subject, grade, title, author, description, html_path, para_count, color, sort_order, is_active)
VALUES
('physics-8', 'physics', 8, 'Физика — 8 класс',
'',
'Полный курс физики 8 класса: тепловые явления (§§1–11), электромагнитные явления (§§12–31), световые явления (§§32–40), 7 виртуальных лабораторных работ.',
'physics_8_hub.html', 47, 'violet', 4, 1);
-- 3. Update the parent physics-8 hub row (covers case where it already existed from legacy migrations).
UPDATE textbooks
SET
author = '',