Don't distinguish between truncate and drop during schema upgrades #41

Open
opened 2026-09-06 08:56:50 +02:00 by c.fahner · 0 comments
Owner

Currently the UpgradeOptions object allows distinguishing between data loss through truncation and data loss through dropping columns, however there is no reason for these to be two separate properties.

The intended use of these properties is to allow schema upgrades in two steps. One step before the data is destroyed where data in columns about-to-be-deleted/truncated can be transferred into new columns/tables and a second step where the old columns are truncated or removed.

Therefor, the UpgradeOptions object can be simplified to have a single property called $allowLoss. Both $allowTruncate and $allowDrop should then be removed.

The issue raised in #40 is still valid. Implementations should still prevent truncation, but any other modifications should still go through.

Currently the `UpgradeOptions` object allows distinguishing between data loss through truncation and data loss through dropping columns, however there is no reason for these to be two separate properties. The intended use of these properties is to allow schema upgrades in two steps. One step before the data is destroyed where data in columns about-to-be-deleted/truncated can be transferred into new columns/tables and a second step where the old columns are truncated or removed. Therefor, the `UpgradeOptions` object can be simplified to have a single property called `$allowLoss`. Both `$allowTruncate` and `$allowDrop` should then be removed. The issue raised in #40 is still valid. Implementations should still prevent truncation, but any other modifications should still go through.
c.fahner added this to the v0.2 milestone 2026-09-06 08:56:50 +02:00
c.fahner changed title from Combine allowTruncate and allowDrop into a single allowLoss property to Don't distinguish truncate and drop during schema upgrades 2026-09-06 08:59:28 +02:00
c.fahner changed title from Don't distinguish truncate and drop during schema upgrades to Don't distinguish between truncate and drop during schema upgrades 2026-09-06 08:59:49 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
slendium/ocd#41
No description provided.