legion-data 1.4.17 → 1.4.19

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: 553774f2d1b934cfad7a7c13f6b87dbcee6c30092c9b7b2b1763108e9f718492
4
- data.tar.gz: 01f2e52421540967cad7d9679a20f430f73267415c840af08728d039e224d8be
3
+ metadata.gz: 2499b458fda547ac0989640906effc26f4c33356a93a26d6aeec200df1b68be0
4
+ data.tar.gz: e20518509eed42492608af61577e4dcc7810bb8a8a7b8e68451cd6081672d0a1
5
5
  SHA512:
6
- metadata.gz: '0108d46d80e410069b73c683091f9eaa07b773492429a2caba79660c369c3fb7fc4674fd1d0b43a8a872f1604ab2af0c30e41ab2e685e71642b287b5706ed1d6'
7
- data.tar.gz: 18edf4b93b7f8f85e333a6c680e1d8ca9588db236a2404d59852f06771abc61a86bb7ab998500040604aa91073b144390b7c7b1fa95fdcdb24c004a82ac2fb17
6
+ metadata.gz: ca9b03c95aae78c9811d00ba6be7b523138c945224f2ab3b5908cb0b0693868c44cb9c97ea8b53cc37e443ce10d6b9861e495fe64caca112118360c94eaced70
7
+ data.tar.gz: 2f57f054e1fe89c1c31bb4ad37446c2220ce2a6038e3338ab1c80faeea549a248866ae95eb9d8a2f0d13d1587cb7e8b4c20b06e09c0f55c8193c88f801e07425
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Legion::Data Changelog
2
2
 
3
+ ## [1.4.19] - 2026-03-23
4
+
5
+ ### Fixed
6
+ - Fix Style/SymbolArray in conversations migration
7
+
8
+ ## [1.4.18] - 2026-03-23
9
+
10
+ ### Fixed
11
+ - Fix extension migration timing: late `register_migrations` calls now run immediately if DB is connected
12
+ - Fix cross-extension schema_migrations conflicts with per-extension migration tables
13
+
3
14
  ## [1.4.17] - 2026-03-22
4
15
 
5
16
  ### Added
@@ -33,6 +33,7 @@ module Legion
33
33
  def register_migrations(name:, path:)
34
34
  @registered_migrations ||= {}
35
35
  @registered_migrations[name] = path
36
+ run_single_migration(name, path) if connected?
36
37
  end
37
38
 
38
39
  def registered_migrations
@@ -57,15 +58,21 @@ module Legion
57
58
  def run_migrations
58
59
  return unless local_settings.dig(:migrations, :auto_migrate) != false
59
60
 
60
- registered_migrations.each_value do |path|
61
- next unless File.directory?(path)
62
-
63
- ::Sequel::TimestampMigrator.new(@connection, path).run
64
- rescue StandardError => e
65
- Legion::Logging.warn "Local migration failed for #{path}: #{e.message}" if defined?(Legion::Logging)
61
+ registered_migrations.each do |name, path|
62
+ run_single_migration(name, path)
66
63
  end
67
64
  end
68
65
 
66
+ def run_single_migration(name, path)
67
+ return unless local_settings.dig(:migrations, :auto_migrate) != false
68
+ return unless File.directory?(path)
69
+
70
+ table = :"schema_migrations_#{name}"
71
+ ::Sequel::TimestampMigrator.new(@connection, path, table: table).run
72
+ rescue StandardError => e
73
+ Legion::Logging.warn "Local migration failed for #{path}: #{e.message}" if defined?(Legion::Logging)
74
+ end
75
+
69
76
  def local_settings
70
77
  return {} unless defined?(Legion::Settings)
71
78
 
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ Sequel.migration do
4
+ up do
5
+ create_table(:conversations) do
6
+ String :id, primary_key: true, size: 64
7
+ String :caller_identity, size: 255
8
+ String :metadata, text: true
9
+ DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
10
+ DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
11
+ end
12
+
13
+ create_table(:conversation_messages) do
14
+ primary_key :id
15
+ String :conversation_id, size: 64, null: false
16
+ Integer :seq, null: false
17
+ String :role, size: 32, null: false
18
+ String :content, text: true
19
+ String :provider, size: 64
20
+ String :model, size: 128
21
+ Integer :input_tokens
22
+ Integer :output_tokens
23
+ DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
24
+
25
+ index %i[conversation_id seq], unique: true
26
+ foreign_key [:conversation_id], :conversations, key: :id
27
+ end
28
+ end
29
+
30
+ down do
31
+ drop_table(:conversation_messages)
32
+ drop_table(:conversations)
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.4.17'
5
+ VERSION = '1.4.19'
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.4.17
4
+ version: 1.4.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -136,6 +136,7 @@ files:
136
136
  - lib/legion/data/migrations/035_add_apollo_source_channel.rb
137
137
  - lib/legion/data/migrations/036_add_audit_context_snapshot.rb
138
138
  - lib/legion/data/migrations/037_add_apollo_knowledge_domain.rb
139
+ - lib/legion/data/migrations/038_add_conversations.rb
139
140
  - lib/legion/data/model.rb
140
141
  - lib/legion/data/models/apollo_access_log.rb
141
142
  - lib/legion/data/models/apollo_entry.rb