Basic new MVP with control tower fully functional

This commit is contained in:
Marcelo Dares
2025-12-31 01:17:13 +00:00
parent a369a69978
commit 363c9fbf4f
11 changed files with 284 additions and 577 deletions

View File

@@ -1,27 +0,0 @@
-- CreateTable
CREATE TABLE "MachineCycle" (
"id" TEXT NOT NULL,
"orgId" TEXT NOT NULL,
"machineId" TEXT NOT NULL,
"ts" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"cycleCount" INTEGER,
"actualCycleTime" DOUBLE PRECISION NOT NULL,
"theoreticalCycleTime" DOUBLE PRECISION,
"workOrderId" TEXT,
"sku" TEXT,
"cavities" INTEGER,
"goodDelta" INTEGER,
"scrapDelta" INTEGER,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "MachineCycle_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "MachineCycle_orgId_machineId_ts_idx" ON "MachineCycle"("orgId", "machineId", "ts");
-- CreateIndex
CREATE INDEX "MachineCycle_orgId_machineId_cycleCount_idx" ON "MachineCycle"("orgId", "machineId", "cycleCount");
-- AddForeignKey
ALTER TABLE "MachineCycle" ADD CONSTRAINT "MachineCycle_machineId_fkey" FOREIGN KEY ("machineId") REFERENCES "Machine"("id") ON DELETE RESTRICT ON UPDATE CASCADE;