feat(mes): Week 1 — PostgreSQL mes_core schema + Alembic migrations#139
Merged
Conversation
Introduces services/mes/ — the MES Core microservice layer for FactoryLM. Implements Walker Reynolds' 8-Week MES Bootcamp schema (Session 1) translated to our stack. Changes: - services/mes/: FastAPI skeleton + SQLAlchemy 2.x + Alembic setup - 7 tables: lines, products, work_orders, schedules, downtime_reasons, machine_states, oee_snapshots - 5 PostgreSQL enum types + 6 performance indexes - Seed: 14 downtime reason codes, 2 production lines (ISA-95 paths) - Pydantic UDTs: LineDataType, CountDispatch, OEEDataType - infra/scada/mes.Dockerfile + docker-compose.yml (port 5434) - 11/11 acceptance tests passing Closes: Mikecranesync/MIRA#319 PRD: docs/PRD-MES-CORE.md Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
services/mes/— first MES microservice in the factorylm monorepomes_core) with full Alembic migration/api/healthonly — Week 2 adds full routes)factorylm-mes-db(Postgres 16, port 5434) +factorylm-mes(port 8300)Tables created
lines·products·work_orders·schedules·downtime_reasons·machine_states·oee_snapshotsSeed data
Test plan
alembic upgrade head— clean migration, no errorspytest tests/test_schema.py -v— 11/11 passingRelated
docs/PRD-MES-CORE.md🤖 Generated with Claude Code
via Happy