annotated icon indicating copy to clipboard operation
annotated copied to clipboard

💡 Obsolete column attribute for save column drop

Open gam6itko opened this issue 10 months ago • 0 comments
trafficstars

I have one database and several services are connected to it, let's say 3 of them (A, B, C). I need to drop deprecated column in one of the tables.

I can simply delete Entity property, make a migration and apply it in service A. Then the other 2 services will start throwing errors that the column is missing. In this case, I need to update them ASAP. This is not always possible.

What if we add a new property to Column obsolete/deprecated/disable/forgotten/you_name_it) ? This property:

  • tells schema-builder not to render schema for this column
  • tells query-builder not to build queries with this column
  • tells the migrator not to generate dropColumn for this column

In this case, we could first mark the column as obsolete, deploy update to all services. Second step - we can delete Entity property, create migration with dropColumn and safely apply at all services.

gam6itko avatar Jan 23 '25 17:01 gam6itko