# Sub Dictionary: `tbl_{X}SubModules`

> Pattern template - applies to **17 tables** (programs: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
> Representative table: `tbl_1SubModules` (program 1)

## Table Info

| Property | Value |
|----------|-------|
| Pattern | `tbl_{X}SubModules` |
| Database | quitsure |
| Connection | `mysql` |
| Engine | InnoDB |
| Laravel Model | `SubModule` (app/Models/SubModule.php) |
| Table Resolution | `SubModule::forProgram($programId)` |

### Actual Tables

| Program | Table Name |
|---------|------------|
| 1 | `tbl_1SubModules` |
| 2 | `tbl_2SubModules` |
| 3 | `tbl_3SubModules` |
| 4 | `tbl_4SubModules` |
| 5 | `tbl_5SubModules` |
| 6 | `tbl_6SubModules` |
| 7 | `tbl_7SubModules` |
| 8 | `tbl_8SubModules` |
| 9 | `tbl_9SubModules` |
| 10 | `tbl_10SubModules` |
| 11 | `tbl_11SubModules` |
| 12 | `tbl_12SubModules` |
| 13 | `tbl_13SubModules` |
| 14 | `tbl_14SubModules` |
| 15 | `tbl_15SubModules` |
| 16 | `tbl_16SubModules` |
| 17 | `tbl_17SubModules` |

## Columns

| # | Column | Type | Nullable | Default | Key | Extra | Description |
|---|--------|------|----------|---------|-----|-------|-------------|
| 1 | `iSubModuleId` | `int unsigned` | NO | - | PRI | auto_increment | Integer: Sub Module Id (likely FK) |
| 2 | `iChapterId` | `int unsigned` | NO | - | MUL | - | Integer: Chapter Id (likely FK) |
| 3 | `vType` | `varchar(100)` | YES | `1` | - | - | Varchar: Type |
| 4 | `iPrevSubModule` | `int unsigned` | YES | NULL | MUL | - | Integer: Prev Sub Module |
| 5 | `iNextSubModule` | `int unsigned` | YES | NULL | MUL | - | Integer: Next Sub Module |
| 6 | `dDateCreated` | `datetime` | NO | `CURRENT_TIMESTAMP` | - | DEFAULT_GENERATED | Datetime: Date Created |
| 7 | `dContentUpdated` | `datetime` | YES | NULL | - | - | Datetime: Content Updated |
| 8 | `bDeleted` | `tinyint(1)` | YES | `0` | MUL | - | Boolean/Flag: Deleted |
| 9 | `iNum` | `int unsigned` | YES | `1` | - | - | Integer: Num |
| 10 | `dDateUpdated` | `datetime` | YES | NULL | - | - | Datetime: Date Updated |
| 11 | `vButtonText` | `varchar(100)` | YES | `NEXT` | - | - | Varchar: Button Text |
| 12 | `vButton2Text` | `varchar(255)` | YES | NULL | - | - | Varchar: Button2Text |
| 13 | `iButton2SubModule` | `int unsigned` | YES | NULL | - | - | Integer: Button2Sub Module |
| 14 | `bFeedback` | `tinyint(1)` | NO | `0` | - | - | Boolean/Flag: Feedback |
| 15 | `bFixed` | `tinyint(1)` | NO | `0` | - | - | Boolean/Flag: Fixed |
| 16 | `iAlternateId` | `int unsigned` | YES | `0` | - | - | Integer: Alternate Id (likely FK) |
| 17 | `iOriginalId` | `int unsigned` | YES | `0` | - | - | Integer: Original Id (likely FK) |
| 18 | `vCondition` | `varchar(500)` | YES | NULL | - | - | Varchar: Condition |
| 19 | `vButton1to2` | `varchar(255)` | YES | NULL | - | - | Varchar: Button1to2 |
| 20 | `vButton2to1` | `varchar(255)` | YES | NULL | - | - | Varchar: Button2to1 |
| 21 | `bAltContent` | `tinyint(1)` | NO | `0` | - | - | Boolean/Flag: Alt Content |

## Indexes

| Name | Columns | Unique | Type |
|------|---------|--------|------|
| `bDeleted` | `bDeleted` | NO | BTREE |
| `iChapterId` | `iChapterId` | NO | BTREE |
| `iNextModuleId` | `iNextSubModule` | NO | BTREE |
| `iPrevModuleId` | `iPrevSubModule` | NO | BTREE |
| `PRIMARY` | `iSubModuleId` | YES | BTREE |

## Foreign Keys

### Formal Foreign Keys

None defined.

### Implicit Relationships (from column naming)

| Column | Likely References |
|--------|------------------|
| `iChapterId` | `tbl_{X}Chapters.iChapterId (program-specific)` |

## Laravel Eloquent Relationships

| Method | Type | Related Model | Foreign Key |
|--------|------|--------------|-------------|
| `chapter()` | belongsTo | `Chapter` | `iChapterId` |
