Files
opensourcepos/app/Database
objecttothis 450c0866b5 Add Guards to Database Migration (#4571)
* Properly replace key in config file when encryption key is updated

This fixes a break caused if there is a commented out key in the .env. It's a more robust replacement.

Signed-off-by: objec <objecttothis@gmail.com>

* Guard against dropping constraint that doesn't exist

- Updated wording in migration_helper.php PHPdoc
- Use migration_helper function to drop key which only drops the constraint if it exists.

The core logic was not changed here. It only adds a safety mechanism.

Signed-off-by: objec <objecttothis@gmail.com>

* Remove duplicate call to getResultArray in attribute_links loop

Signed-off-by: objec <objecttothis@gmail.com>

* PSR refactoring

Signed-off-by: objec <objecttothis@gmail.com>

* Remove dead parameter from reassignDuplicateAttributeValues method

The attribute value was not needed and is never used since we have the attribute_ids and those are unique.

Signed-off-by: objec <objecttothis@gmail.com>

* Create potentially missing primary keys before attempting to add constraints.

Signed-off-by: objec <objecttothis@gmail.com>

* Guard datetime creation

Signed-off-by: objec <objecttothis@gmail.com>

* Update regex pattern to handle double-quoted and non-quoted encryption keys

Signed-off-by: objec <objecttothis@gmail.com>

* Issue warning and fallback on unparseable attribute_date during

Signed-off-by: objec <objecttothis@gmail.com>

---------

Signed-off-by: objec <objecttothis@gmail.com>
2026-06-06 02:02:42 +04:00
..
2024-06-15 17:19:15 +02:00