chronomodel
chronomodel copied to clipboard
Temporal PostgreSQL (9.4+) system with "flashback" framework for ActiveRecord (7.0+)
Why is the PK excluded when setting default values on the columns of the views? https://github.com/ifad/chronomodel/blob/b00d08c2196ca6f3e2bacc88c309e620e7559507/lib/chrono_model/adapter/ddl.rb#L33
```rb # frozen_string_literal: true require 'bundler/inline' gemfile(true) do source 'https://rubygems.org' gem 'chrono_model' # Test against latest Chronomodel: # gem 'chrono_model', github: 'ifad/chronomodel' gem 'pg' gem 'debug' gem 'rails' end require...
### Reproducible test case ```rb # frozen_string_literal: true require 'bundler/inline' gemfile(true) do source 'https://rubygems.org' gem 'chrono_model' # Test against latest Chronomodel: # gem 'chrono_model', github: 'ifad/chronomodel' gem 'pg' gem 'debug'...
Finding `*_by_sql` does not work on historical queries ``` Country.as_of(1.day.ago).first.name Country Load (3.2ms) SELECT "countries".* FROM (SELECT "history"."countries".* FROM "history"."countries" WHERE ( '2024-06-07 15:28:39.371662'::timestamp "France" > Country.first.name Country Load (0.6ms)...
### Models ```rb class Country < ApplicationRecord include ChronoModel::TimeMachine has_many :cities, dependent: :destroy has_one :council has_one :first_member, through: :council end class Council < ApplicationRecord include ChronoModel::TimeMachine belongs_to :country has_many :members,...
Same issue as #283, since `as_of_time` is an alias of `valid_to` in historical objects, but may have different effects ``` > country.history.first.validity Country::History Load (1.2ms) SELECT "history"."countries".* FROM "history"."countries" WHERE...
Ref: #295
 so we know. that the validity of an object is an open ended range `[t1,t2)` but if there is something associated to this object, the query that chronomodel does...
When using `t.references` or `t.belongs_to` in a migration, Chronomodel does not create the reference index in the historical table ### Reproducible test case ```rb # frozen_string_literal: true require 'bundler/inline' gemfile(true)...