# Simple Package Version Tracking

## Overview

Simple Oracle package version tracking system with a **clear package list** at the beginning of the script.

> **📖 For comprehensive deployment workflow, see:** [Package Deployment Guide](Package_Deployment_Guide.md)  
> This document covers only the tracking script usage. For full deployment process, version update guidelines, and troubleshooting, refer to the main deployment guide.

## Available Scripts

1. **track_package_versions.sql** - Tracks package versions in ENV_MANAGER system
2. **verify_packages_version.sql** - Verifies all tracked packages for code changes

## How to Use?

### Step 1: Edit Package List

Open `track_package_versions.sql` and edit the package list section:

```sql
-- ===================================================================
-- PACKAGE LIST - Edit this array to specify packages to track
-- ===================================================================
vPackageList t_string_array := t_string_array(
   'CT_MRDS.FILE_MANAGER',
   'ODS.FILE_MANAGER_ODS'
   -- Add more packages here:
   -- ,'CT_MRDS.DATA_EXPORTER'
   -- ,'MRDS_LOADER.CLOUD_WRAPPER'
);
-- ===================================================================
```

### Step 2: Use in Your Script

```sql
-- install_mars1049.sql
PROMPT Installing packages...
@@new_version/FILE_MANAGER.pkg
@@new_version/FILE_MANAGER.pkb

PROMPT Tracking versions...
@@track_package_versions.sql

PROMPT Verifying all packages...
@@verify_packages_version.sql
```

## Script Details

### track_package_versions.sql
- **Purpose**: Register package versions in A_PACKAGE_VERSION_TRACKING
- **When**: After installing/rolling back packages
- **Output**: Simple list of package versions

### verify_packages_version.sql
- **Purpose**: Verify all tracked packages for code changes
- **When**: At the end of install/rollback scripts
- **Output**: Detailed status for all tracked packages (OK/WARNING)

## Example Output

```
========================================
Package Version Tracking
========================================
Packages tracked: 2 of 2

CT_MRDS.FILE_MANAGER = 3.2.1
ODS.FILE_MANAGER_ODS = 2.1.0
========================================
```

## Configuration Examples

### MARS-1049 (FILE_MANAGER System)
```sql
vPackageList t_string_array := t_string_array(
   'CT_MRDS.FILE_MANAGER',
   'ODS.FILE_MANAGER_ODS'
);
```

### MARS-1011 (WORKFLOW_MANAGER)
```sql
vPackageList t_string_array := t_string_array(
   'CT_MRDS.WORKFLOW_MANAGER'
);
```

### System with Multiple Packages
```sql
vPackageList t_string_array := t_string_array(
   'CT_MRDS.FILE_MANAGER',
   'CT_MRDS.DATA_EXPORTER',
   'CT_MRDS.FILE_ARCHIVER',
   'ODS.FILE_MANAGER_ODS',
   'MRDS_LOADER.CLOUD_WRAPPER'
);
```

## Requirements

Each package in the list must have:
```sql
FUNCTION GET_VERSION RETURN VARCHAR2;
```

## Benefits

- **Clear List** - see immediately which packages are tracked
- **Easy Editing** - add/remove package lines
- **Zero Configuration** - aside from the package list
- **Universal** - copy script to any MARS issue
- **Simple Output** - just package names and versions