pms_schema)pms_schema holds PMS-owned tables (t_project, m_customer, and children). portal_schema owns m_entity and m_employee — PMS only references them. m_agreement is read from CMS (cover_letters). No Arsi/Conexus API at launch — customer rows are created in PMS (POST /customers or inline on projects). Conexus/CMS catalogs are optional lookup only. Chat and notifications (Claim port) use Portal uam / pms_schema chat tables.
portal_schema — not provisioned by PMSFrom backend-pms-dev/script/initial_table.sql prerequisites:
| Table | Used by PMS | Source |
|---|---|---|
portal_schema.m_entity | t_project.entity_code → m_entity.code | Project portal |
portal_schema.m_employee | t_project.created_id, updated_id; t_project_pic.user_id; t_doc.uploaded_by_user_id | Portal SSO |
TypeORM layout ( backend-pms-dev ):
| Folder | Entities | Schema constant |
|---|---|---|
src/entity/portal/ | EntityMaster (m_entity), Employee (m_employee) | PORTAL_SCHEMA |
src/entity/pms/ | Customer (m_customer) | PMS_SCHEMA |
src/entity/cms/ | CoverLetter, CounterParty | CMS_SCHEMA via cms connection (optional customer lookup) |
src/entity/portal/ | EntityMaster (m_entity), Employee | portal_schema — PMS entity master (not CMS m_entity) |
src/entity/pms/ | t_project + children, m_doc_type, m_service_category, … | PMS_SCHEMA |
Portal entities are read/join targets — not created in initial_table.sql.
pms_schema — owned by PMS (created in initial_table.sql)| Group | Tables |
|---|---|
| Masters (PMS DB) | m_entity, m_customer, m_doc_type, m_service_category, m_tran_code_seq |
| Transactional | t_project, t_project_pic, t_pid_link, t_sale_line, t_sale_plan, t_cogs_line, t_cogs_plan, t_doc |
Per Project Manager/ERD.md — PMS stores FKs + snapshots on t_project; it does not own the canonical row in the source system:
| PMS-facing | Source of truth | Origin |
|---|---|---|
m_customer | pms_schema.m_customer | PMS (app CRUD) |
m_agreement | cover_letter | CMS |
m_employee | m_employee | Portal SSO (portal_schema at DB layer) |
m_entity is portal-owned at the DB layer (see prerequisites in SQL); treat like SSO catalog data, not PMS-authored master data.
pms_schema — chat & notifications (Claim port)Not in PMS ERD tables; live on Portal / Claim DB connections:
| Module | Typical entities | Schema / connection |
|---|---|---|
notification | FcmToken, UserNotification | portal_schema via uam |
chat | Conversation, Message, … | pms_schema via uam (context_type=project) |
See [[Projects/anabatic-project-manager/backlog/p1-import-claim-chat-notification-modules]].
CREATE TABLE for m_entity or m_employee under pms_schema.DB_PMS_DB_SCHEMA, DB_PORTAL_DB_SCHEMA, DB_CMS_DB_SCHEMA in env (src/entity/schemas.ts). Do not put portal/cms entity files under entity/pms/ except PMS-owned masters./entities, /employees, …) should read external catalogs, not imply PMS owns the physical table in pms_schema.Project Manager/backend-pms-dev/script/initial_table.sql (header comments)Project Manager/ERD.md