bmad初始化

This commit is contained in:
2025-11-01 19:22:39 +08:00
parent 5b21dc0bd5
commit 426ae41f54
447 changed files with 80633 additions and 0 deletions

71
bmad/data-models-main.md Normal file
View File

@@ -0,0 +1,71 @@
# Data Models - Main
This document outlines the database models (tables) used in the Pig Farm Controller application, primarily managed by GORM.
## Overview
The `GetAllModels()` function in `internal/infra/models/models.go` provides a comprehensive list of all GORM models, which correspond to the database tables. This ensures that all necessary tables are migrated during database initialization.
## Database Tables
Below is a list of all identified database tables:
### Core Models
* `User`
* `UserActionLog`
### Device Models
* `Device`
* `AreaController`
* `DeviceTemplate`
* `SensorData`
* `DeviceCommandLog`
### Plan & Task Models
* `Plan`
* `SubPlan`
* `Task`
* `PlanExecutionLog`
* `TaskExecutionLog`
* `PendingTask`
* `PendingCollection`
### Farm Asset Models
* `PigHouse`
* `Pen`
### Pig & Batch Models
* `PigBatch`
* `PigBatchLog`
* `WeighingBatch`
* `WeighingRecord`
* `PigTransferLog`
* `PigSickLog`
### Pig Buy & Sell Models
* `PigPurchase`
* `PigSale`
### Feed Models
* `RawMaterial`
* `RawMaterialPurchase`
* `RawMaterialStockLog`
* `FeedFormula`
* `FeedFormulaComponent`
* `FeedUsageRecord`
### Medication Models
* `Medication`
* `MedicationLog`
### Notification Models
* `Notification`