# Sub Dictionary: `tbl_{X}Chapters`

> 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_1Chapters` (program 1)

## Table Info

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

### Actual Tables

| Program | Table Name |
|---------|------------|
| 1 | `tbl_1Chapters` |
| 2 | `tbl_2Chapters` |
| 3 | `tbl_3Chapters` |
| 4 | `tbl_4Chapters` |
| 5 | `tbl_5Chapters` |
| 6 | `tbl_6Chapters` |
| 7 | `tbl_7Chapters` |
| 8 | `tbl_8Chapters` |
| 9 | `tbl_9Chapters` |
| 10 | `tbl_10Chapters` |
| 11 | `tbl_11Chapters` |
| 12 | `tbl_12Chapters` |
| 13 | `tbl_13Chapters` |
| 14 | `tbl_14Chapters` |
| 15 | `tbl_15Chapters` |
| 16 | `tbl_16Chapters` |
| 17 | `tbl_17Chapters` |

## Columns

| # | Column | Type | Nullable | Default | Key | Extra | Description |
|---|--------|------|----------|---------|-----|-------|-------------|
| 1 | `iChapterId` | `int unsigned` | NO | - | PRI | auto_increment | Integer: Chapter Id (likely FK) |
| 2 | `iDayId` | `int unsigned` | YES | NULL | MUL | - | Integer: Day Id (likely FK) |
| 3 | `vTitle` | `varchar(150)` | YES | NULL | - | - | Varchar: Title |
| 4 | `vBackgroundImg` | `varchar(150)` | YES | NULL | - | - | Varchar: Background Img |
| 5 | `vContentLink` | `varchar(150)` | YES | NULL | - | - | Varchar: Content Link |
| 6 | `iImgWidth` | `smallint unsigned` | YES | NULL | - | - | Integer: Img Width |
| 7 | `iImgHeight` | `smallint unsigned` | YES | NULL | - | - | Integer: Img Height |
| 8 | `bActive` | `tinyint(1)` | YES | NULL | - | - | Boolean/Flag: Active |
| 9 | `bDeleted` | `tinyint(1)` | YES | NULL | MUL | - | Boolean/Flag: Deleted |
| 10 | `dDateCreated` | `datetime` | YES | `CURRENT_TIMESTAMP` | - | DEFAULT_GENERATED | Datetime: Date Created |
| 11 | `dDateUpdated` | `datetime` | YES | NULL | - | - | Datetime: Date Updated |
| 12 | `iNum` | `int unsigned` | YES | NULL | MUL | - | Integer: Num |
| 13 | `dContentUpdated` | `datetime` | YES | NULL | - | - | Datetime: Content Updated |
| 14 | `bFree` | `tinyint(1)` | YES | `0` | - | - | Boolean/Flag: Free |
| 15 | `iFirstSubModule` | `int unsigned` | YES | NULL | - | - | Integer: First Sub Module |
| 16 | `iABTest` | `tinyint` | YES | `0` | - | - | Integer: AB Test |
| 17 | `bFeedback` | `tinyint(1)` | NO | `0` | - | - | Boolean/Flag: Feedback |
| 18 | `bStoreRating` | `int unsigned` | NO | `0` | - | - | Boolean/Flag: Store Rating |
| 19 | `bShowSubScreen` | `tinyint(1)` | NO | `0` | - | - | Boolean/Flag: Show Sub Screen |
| 20 | `bOptional` | `tinyint(1)` | NO | `0` | - | - | Boolean/Flag: Optional |

## Indexes

| Name | Columns | Unique | Type |
|------|---------|--------|------|
| `idx_tbl_Chapters_bDeleted` | `bDeleted` | NO | BTREE |
| `idx_tbl_Chapters_iChapterId` | `iChapterId` | NO | BTREE |
| `idx_tbl_Chapters_iDayId` | `iDayId` | NO | BTREE |
| `idx_tbl_Chapters_iNum` | `iNum` | NO | BTREE |
| `PRIMARY` | `iChapterId` | YES | BTREE |

## Foreign Keys

### Formal Foreign Keys

None defined.


## Laravel Eloquent Relationships

| Method | Type | Related Model | Foreign Key |
|--------|------|--------------|-------------|
| `day()` | belongsTo | `Day` | `iDayID` |
