LifeMate — Personal, Family & Learning Companion
test: verify final feature schema privacy defaults
davoodmehraban89 committed
Oct 5, 2026 at 19:45 UTC
1672729fb6d4f760f6616b5348ef91abee9b36c6
1 file changed
+12
backend/tests/phase6_schema_test.sql
new
+12
@@ -0,0 +1,12 @@
1
+\set ON_ERROR_STOP on
2
+
3
+do $$
4
+begin
5
+ if not exists(select 1 from information_schema.columns where table_name='profile' and column_name='household_persona') then raise exception 'household persona missing'; end if;
6
+ if not exists(select 1 from information_schema.tables where table_name='education_profile') then raise exception 'education profile missing'; end if;
7
+ if not exists(select 1 from information_schema.tables where table_name='menstrual_cycle_entry') then raise exception 'cycle table missing'; end if;
8
+ if (select count(*) from curriculum_subject where national_grade=7 and school_year='1405-1406') < 10 then raise exception 'grade 7 catalog incomplete'; end if;
9
+ if not exists(select 1 from curriculum_subject where national_grade=7 and name_fa='ریاضی') then raise exception 'grade 7 mathematics missing'; end if;
10
+ if exists(select 1 from textbook_catalog where source_host not in ('chap.sch.ir','medu.gov.ir') or source_url !~ '^https://') then raise exception 'untrusted textbook source'; end if;
11
+ if not exists(select 1 from information_schema.columns where table_name='notification_preference' and column_name='sensitive_preview') then raise exception 'sensitive preview control missing'; end if;
12
+end $$;