legion-data 1.6.17 → 1.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 751fcaf222628502475f1d3fd7563f1162836d7de4e3a2949724c2324387890e
4
- data.tar.gz: c6787226b1fce54751d250bf27fecb4ada9538f7c2d466bb9215d4386ae607b8
3
+ metadata.gz: e4eef1be3fc0e69e96629e2ffb38904d83215045af3b1b9d6ae411a511b4d429
4
+ data.tar.gz: f8591ff1b36e7d4c29506b16d6ce1e221093c84e6afba3663af721bda4eacb9f
5
5
  SHA512:
6
- metadata.gz: 1b52c53a9993f31862973c3b4117b985c21aa5a344979083dcd69b912c00be6c42461e45a5e583970dfe9ae2824841e869a89d4cdf3eab46fb15f6a66d698e91
7
- data.tar.gz: f35cbc4955c14f93a4c5fea5188fd766cf8b09061467d9764de56835ff7a2f95ada6c5e976c3fcf6e41b2af69f850dbf0e6e53d66d98be6ded80db6894cc8cf3
6
+ metadata.gz: d002c25b1355b3da5770277e486a566967513d1502a09f3b5c19f8e905b3973fb9f0d94856f20082b79168a6035e1d0e71c51a610667c23661a3c06bc60dd1bf
7
+ data.tar.gz: fbeb431cc34bd8920d77ded479a7beb579bcdb06f500f6174dbcdaef4f6aa13c726a144b6cba8bd4b581fedc4d9129f45d7883263f55f0ae90bf690baf816ea9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.18] - 2026-03-30
6
+
7
+ ### Added
8
+ - Migration 061: versioning and expiry columns on `apollo_entries` — `parent_knowledge_id` (UUID), `is_latest` (boolean, default true), `supersession_type` (VARCHAR 20), `expires_at` (timestamptz), `forget_reason` (VARCHAR 255), `is_inference` (boolean, default false) — postgres only
9
+ - Migration 061: 4 named indexes including partial indexes: `idx_apollo_parent_knowledge`, `idx_apollo_version_chain` (partial WHERE is_latest), `idx_apollo_expiry` (partial WHERE expires_at IS NOT NULL), `idx_apollo_inference` (partial WHERE is_inference)
10
+ - Spec for migration 061 covering column presence, types, nullability, defaults, all 4 indexes, and idempotency
11
+
5
12
  ## [1.6.17] - 2026-03-30
6
13
 
7
14
  ### Added
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ next unless adapter_scheme == :postgres
6
+ next unless table_exists?(:apollo_entries)
7
+
8
+ existing_columns = schema(:apollo_entries).map(&:first)
9
+
10
+ alter_table(:apollo_entries) do
11
+ add_column :parent_knowledge_id, :uuid, null: true unless existing_columns.include?(:parent_knowledge_id)
12
+ add_column :is_latest, :boolean, null: false, default: true unless existing_columns.include?(:is_latest)
13
+ add_column :supersession_type, String, size: 20, null: true unless existing_columns.include?(:supersession_type)
14
+ add_column :expires_at, :timestamptz, null: true unless existing_columns.include?(:expires_at)
15
+ add_column :forget_reason, String, size: 255, null: true unless existing_columns.include?(:forget_reason)
16
+ add_column :is_inference, :boolean, null: false, default: false unless existing_columns.include?(:is_inference)
17
+ end
18
+
19
+ add_index :apollo_entries, :parent_knowledge_id, name: :idx_apollo_parent_knowledge, if_not_exists: true
20
+ add_index :apollo_entries, %i[parent_knowledge_id is_latest],
21
+ name: :idx_apollo_version_chain,
22
+ where: Sequel.lit('is_latest = true'),
23
+ if_not_exists: true
24
+ add_index :apollo_entries, :expires_at,
25
+ name: :idx_apollo_expiry,
26
+ where: Sequel.lit("expires_at IS NOT NULL AND status != 'archived'"),
27
+ if_not_exists: true
28
+ add_index :apollo_entries, :is_inference,
29
+ name: :idx_apollo_inference,
30
+ where: Sequel.lit('is_inference = true'),
31
+ if_not_exists: true
32
+ end
33
+
34
+ down do
35
+ next unless adapter_scheme == :postgres
36
+ next unless table_exists?(:apollo_entries)
37
+
38
+ existing_columns = schema(:apollo_entries).map(&:first)
39
+
40
+ alter_table(:apollo_entries) do
41
+ drop_column :parent_knowledge_id if existing_columns.include?(:parent_knowledge_id)
42
+ drop_column :is_latest if existing_columns.include?(:is_latest)
43
+ drop_column :supersession_type if existing_columns.include?(:supersession_type)
44
+ drop_column :expires_at if existing_columns.include?(:expires_at)
45
+ drop_column :forget_reason if existing_columns.include?(:forget_reason)
46
+ drop_column :is_inference if existing_columns.include?(:is_inference)
47
+ end
48
+ end
49
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.6.17'
5
+ VERSION = '1.6.18'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.17
4
+ version: 1.6.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -190,6 +190,7 @@ files:
190
190
  - lib/legion/data/migrations/058_add_audit_records.rb
191
191
  - lib/legion/data/migrations/059_create_chains.rb
192
192
  - lib/legion/data/migrations/060_add_knowledge_tiers.rb
193
+ - lib/legion/data/migrations/061_add_versioning_and_expiry.rb
193
194
  - lib/legion/data/model.rb
194
195
  - lib/legion/data/models/apollo_access_log.rb
195
196
  - lib/legion/data/models/apollo_entry.rb