Soft deletion with PostgreSQL: but with logic on the database!
Any developer eventually faces a challenge: making significant changes to large code bases. But here, I’ll walk through an unorthodox solution which allows all the application code’s complexity to remain untouched thanks to the might and power of the underlying database! It’s soft deletion, but we’ll put the logic in the database itself. Keep reading for the ‘how’ and ‘why’!While this post is primarily about PostgreSQL, I’ll need to touch the application code a couple of times. Since Ruby on Rails is the stack I have the most experience with, I’ll be using it in my examples. Although Rubyists might have extra appreciation for this article, but let’s emphasize up front that the final solution will be completely in SQL.
Soft deletion with PostgreSQL: but with logic on the database! #ruby #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper