{"repo":"waymondo/hoardable","free":true,"listed":false,"github":"https://github.com/waymondo/hoardable","clone":"git clone https://github.com/waymondo/hoardable.git","description":"ActiveRecord versioning and soft-deletion with Postgres using uni-temporal inherited tables","language":"Ruby","stars":57,"topics":["activerecord","database","postgresql","rails","ruby","soft-delete","versioning","postgres"],"license":"MIT","category":"databases-storage","readme_excerpt":"Hoardable Hoardable is an ActiveRecord extension for Ruby 3+, Rails 7+, and PostgreSQL 9+ that allows for versioning and soft-deletion of records through the use of uni-temporal inherited tables . Temporal tables are a database design pattern where each row of a table contains data along with one or more time ranges. In the case of this gem, each database row has a time range that represents the row’s valid time range - hence \"uni-temporal\". Table inheritance is a feature of PostgreSQL that allows one table to inherit all columns from a parent. The descendant table’s schema will stay in sync with its parent; if a new column is added to or removed from the parent, the schema change is reflected on its descendants. With these concepts combined, hoardable offers a model versioning and soft deletion system for Rails. Versions of records are stored in separate, inherited tables along with their valid time ranges and contextual data. 👉 Documentation Installation Add this line to your application's Gemfile: Run bundle install , and then run: Model installation Include Hoardable::Model into an ActiveRecord model you would like to hoard versions of: Run the generator command to create a database migration and migrate it: Note : Creating an inherited table does not inherit the indexes from the parent table. If you need to query versions often, you should add appropriate indexes to the versions tables. Usage Overview Once you include Hoardable::Model into a model, it will dynamically g","default_branch":null,"files":null,"tree":[],"storefront":"/r/waymondo","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/waymondo/hoardable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}