Fix database schema documentation to match actual tables

- Fix table names: pc_comm_config → commconfig, pc_dnc_config → dncconfig
- Fix column name: communications.gateway → defaultgateway
- Clarify printers uses 'ipaddress' while communications uses 'address'
- Update CREATE TABLE statements to match actual schema
- Add warranties table to QUICK_REFERENCE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-11 17:09:44 -05:00
parent 76c6145bf7
commit d1a93979f2
3 changed files with 54 additions and 45 deletions

View File

@@ -86,10 +86,10 @@ This ASP API replaces the PHP api.php and provides the same functionality but ru
1. Insert/update record in `machines` table with `pctypeid IS NOT NULL`
2. Clear old network interfaces from `communications`
3. Insert new network interfaces to `communications` with `comstypeid = 1`
4. Clear old serial port configs from `pc_comm_config`
5. Insert new serial port configs to `pc_comm_config`
6. Clear old DNC config from `pc_dnc_config`
7. Insert new DNC config to `pc_dnc_config`
4. Clear old serial port configs from `commconfig`
5. Insert new serial port configs to `commconfig`
6. Clear old DNC config from `dncconfig`
7. Insert new DNC config to `dncconfig`
8. Create PC-to-equipment relationship in `machinerelationships` if `machineNo` provided
9. Update warranty data in `warranties` table
@@ -338,7 +338,7 @@ This ASP API replaces the PHP api.php and provides the same functionality but ru
]
```
**Stored in:** `pc_comm_config` table
**Stored in:** `commconfig` table
---
@@ -362,7 +362,7 @@ This ASP API replaces the PHP api.php and provides the same functionality but ru
}
```
**Stored in:** `pc_dnc_config` table
**Stored in:** `dncconfig` table
**Additional DNC fields sent as separate parameters:**
- `dncDualPathEnabled` - true/false
@@ -407,51 +407,55 @@ CREATE TABLE communications (
address VARCHAR(45), -- IP address
macaddress VARCHAR(17),
subnetmask VARCHAR(45),
gateway VARCHAR(45),
defaultgateway VARCHAR(45),
interfacename VARCHAR(50),
isprimary TINYINT(1),
isactive TINYINT(1)
);
```
#### pc_comm_config (Serial Port Configs)
#### commconfig (Serial Port Configs)
```sql
CREATE TABLE pc_comm_config (
commconfigid INT(11) PRIMARY KEY AUTO_INCREMENT,
machineid INT(11), -- Changed from pcid
portname VARCHAR(50),
baudrate INT(11),
CREATE TABLE commconfig (
configid INT(11) PRIMARY KEY AUTO_INCREMENT,
machineid INT(11),
configtype VARCHAR(50),
portid VARCHAR(20),
baud INT(11),
databits INT(11),
parity VARCHAR(20),
stopbits VARCHAR(20),
flowcontrol VARCHAR(50)
parity VARCHAR(10),
stopbits VARCHAR(5),
ipaddress VARCHAR(45),
socketnumber INT(11),
additionalsettings TEXT,
lastupdated DATETIME
);
```
#### pc_dnc_config (DNC Configuration)
#### dncconfig (DNC Configuration)
```sql
CREATE TABLE pc_dnc_config (
dncconfigid INT(11) PRIMARY KEY AUTO_INCREMENT,
machineid INT(11), -- Changed from pcid
site VARCHAR(50),
cnc VARCHAR(50),
CREATE TABLE dncconfig (
dncid INT(11) PRIMARY KEY AUTO_INCREMENT,
machineid INT(11),
site VARCHAR(100),
cnc VARCHAR(100),
ncif VARCHAR(50),
machinenumber VARCHAR(50),
hosttype VARCHAR(50),
ftphostprimary VARCHAR(100),
ftphostsecondary VARCHAR(100),
ftpaccount VARCHAR(100),
debug VARCHAR(50),
uploads VARCHAR(100),
scanner VARCHAR(50),
dripfeed VARCHAR(50),
additionalsettings VARCHAR(255),
debug VARCHAR(10),
uploads VARCHAR(10),
scanner VARCHAR(10),
dripfeed VARCHAR(10),
additionalsettings TEXT,
dualpath_enabled TINYINT(1),
path1_name VARCHAR(100),
path2_name VARCHAR(100),
path1_name VARCHAR(255),
path2_name VARCHAR(255),
ge_registry_32bit TINYINT(1),
ge_registry_64bit TINYINT(1),
ge_registry_notes VARCHAR(255),
ge_registry_notes TEXT,
lastupdated DATETIME
);
```
@@ -747,8 +751,8 @@ mysql -h 192.168.122.1 -u root -p shopdb < sql/migration_phase2/08_update_schema
```
This renames `pcid``machineid` in:
- `pc_comm_config`
- `pc_dnc_config`
- `commconfig`
- `dncconfig`
### Step 2: Deploy api.asp
@@ -857,11 +861,11 @@ ALTER TABLE machines ADD INDEX idx_machinenumber (machinenumber);
ALTER TABLE communications ADD INDEX idx_machineid (machineid);
ALTER TABLE communications ADD INDEX idx_comstypeid (comstypeid);
-- pc_comm_config table
ALTER TABLE pc_comm_config ADD INDEX idx_machineid (machineid);
-- commconfig table
ALTER TABLE commconfig ADD INDEX idx_machineid (machineid);
-- pc_dnc_config table
ALTER TABLE pc_dnc_config ADD INDEX idx_machineid (machineid);
-- dncconfig table
ALTER TABLE dncconfig ADD INDEX idx_machineid (machineid);
-- machinerelationships table
ALTER TABLE machinerelationships ADD INDEX idx_machineid (machineid);