legion-data 1.4.17 → 1.4.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: 553774f2d1b934cfad7a7c13f6b87dbcee6c30092c9b7b2b1763108e9f718492
4
- data.tar.gz: 01f2e52421540967cad7d9679a20f430f73267415c840af08728d039e224d8be
3
+ metadata.gz: 4b72221cdf5567d6602fa63754684e02cd690ece98810eddc539061b9f4ae19c
4
+ data.tar.gz: 9865f85a9281f562bc9d6160198193f1b0c7b00c8c9132dc7c72b70160dace9d
5
5
  SHA512:
6
- metadata.gz: '0108d46d80e410069b73c683091f9eaa07b773492429a2caba79660c369c3fb7fc4674fd1d0b43a8a872f1604ab2af0c30e41ab2e685e71642b287b5706ed1d6'
7
- data.tar.gz: 18edf4b93b7f8f85e333a6c680e1d8ca9588db236a2404d59852f06771abc61a86bb7ab998500040604aa91073b144390b7c7b1fa95fdcdb24c004a82ac2fb17
6
+ metadata.gz: '049288bc4a3b94d1430b992bb78d693517757fafadac4b65535b873eb8d3d0e3bbb4765d635388badf6df48ec302d06dfc6b04de9f54a85ec8acd805b0e90dda'
7
+ data.tar.gz: 32bb5d25decd349a5dc85c08400c3e2364fca356c62d185a103ec68e47989f0ada735f5d28f1c8405ed3e41172deb8ad590b56b4b4d391ef49b14723335a9adc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Legion::Data Changelog
2
2
 
3
+ ## [1.4.18] - 2026-03-23
4
+
5
+ ### Fixed
6
+ - Fix extension migration timing: late `register_migrations` calls now run immediately if DB is connected
7
+ - Fix cross-extension schema_migrations conflicts with per-extension migration tables
8
+
3
9
  ## [1.4.17] - 2026-03-22
4
10
 
5
11
  ### 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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Legion
4
4
  module Data
5
- VERSION = '1.4.17'
5
+ VERSION = '1.4.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.4.17
4
+ version: 1.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity