tina4ruby 3.13.75 → 3.13.76

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: f7b6cfa07830b59619c790f1724802af5989b3013f7408aa47b35a8ff0dd6ca1
4
- data.tar.gz: 6b107ed9e12d657b5b3ef8e8183a2cb05c1b7c2e3befcc35cd977b9ddabb63ec
3
+ metadata.gz: da6364e88c7169f37da6b3e667d31b9d736448190b6004f07405a5547fff2fb9
4
+ data.tar.gz: 5c98dd7dbf126623a6839b6b0c34b75f05ea2a123f2028602ed9857edd7452b9
5
5
  SHA512:
6
- metadata.gz: 966951da4e142e1083cb21b9123ae44f0f3c1e5750aef15f5f1d27c91fb1c2119e3212d6a26f560705a20ee341286b6b828d0d36dd0ddcbaaf0dc51264f9faa6
7
- data.tar.gz: 831737c53898556428116fdf4992c50f1d658acf21f86209aebf00e09b691162b915504992a2f6a396ee0ff13f46720bc9d4896ef841f373a717e437f860a9d7
6
+ metadata.gz: 972e3873fd9f9bc30171db684976ef9313321c3e7d82c10e09cdbcde43bda9a494d47f322e619f9bd2568f204b9f579589dd3b79c37092539905121176bd1c9c
7
+ data.tar.gz: 262a054d5b6a81a9b6b8f3101dedf70eff3c90117bc57a22a8e4cdbca65e3ea17a604fee65604291ad8c729fbc9b8002eddfbec1d63c24c35a3f4d58a32b861d
@@ -648,22 +648,48 @@ module Tina4
648
648
  # record_migration path it is a standalone write, mirroring the Python
649
649
  # master's two-statement delete-then-insert.
650
650
  _remove_migration_record(name)
651
+
652
+ # Build the column list from the columns that ACTUALLY exist on the table,
653
+ # so a legacy column left behind by an in-place upgrade is populated rather
654
+ # than defaulted to NULL. Ruby never created a `migration_id` column, but a
655
+ # Ruby app can be pointed at a database whose tina4_migration table was
656
+ # created by tina4-python v3 <= 3.13.54 - there `migration_id` is NOT NULL,
657
+ # and an insert that omits it fails, wedging every migration on that
658
+ # database (tina4-python#93). Mirrors the PHP + Python masters.
659
+ cols = _tracking_columns
660
+ insert_cols = %w[migration_name description batch executed_at passed]
661
+ values = [name, desc, batch, executed_at, passed]
662
+
663
+ if cols.include?("migration_id")
664
+ insert_cols << "migration_id"
665
+ values << name
666
+ end
667
+
651
668
  if firebird?
652
669
  # Firebird: generate ID from sequence
653
670
  row = @db.fetch_one(
654
671
  "SELECT GEN_ID(GEN_TINA4_MIGRATION_ID, 1) AS NEXT_ID FROM RDB\$DATABASE"
655
672
  )
656
673
  next_id = row ? (row[:NEXT_ID] || row[:next_id] || 1).to_i : 1
657
- @db.execute(
658
- "INSERT INTO #{TRACKING_TABLE} (id, migration_name, description, batch, executed_at, passed) VALUES (?, ?, ?, ?, ?, ?)",
659
- [next_id, name, desc, batch, executed_at, passed]
660
- )
661
- else
662
- @db.execute(
663
- "INSERT INTO #{TRACKING_TABLE} (migration_name, description, batch, executed_at, passed) VALUES (?, ?, ?, ?, ?)",
664
- [name, desc, batch, executed_at, passed]
665
- )
674
+ insert_cols.unshift("id")
675
+ values.unshift(next_id)
676
+ end
677
+
678
+ placeholders = Array.new(insert_cols.length, "?").join(", ")
679
+ @db.execute(
680
+ "INSERT INTO #{TRACKING_TABLE} (#{insert_cols.join(', ')}) VALUES (#{placeholders})",
681
+ values
682
+ )
683
+ end
684
+
685
+ # Lowercased column names on the tracking table; empty on any failure so a
686
+ # missing/unreadable table falls through to the canonical column list.
687
+ def _tracking_columns
688
+ (@db.columns(TRACKING_TABLE) || []).map do |c|
689
+ (c.is_a?(Hash) ? (c[:name] || c["name"]) : c).to_s.downcase
666
690
  end
691
+ rescue StandardError
692
+ []
667
693
  end
668
694
 
669
695
  def _remove_migration_record(name)
data/lib/tina4/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tina4
4
- VERSION = "3.13.75"
4
+ VERSION = "3.13.76"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tina4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.75
4
+ version: 3.13.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-14 00:00:00.000000000 Z
11
+ date: 2026-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack