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 +4 -4
- data/lib/tina4/migration.rb +35 -9
- data/lib/tina4/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da6364e88c7169f37da6b3e667d31b9d736448190b6004f07405a5547fff2fb9
|
|
4
|
+
data.tar.gz: 5c98dd7dbf126623a6839b6b0c34b75f05ea2a123f2028602ed9857edd7452b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 972e3873fd9f9bc30171db684976ef9313321c3e7d82c10e09cdbcde43bda9a494d47f322e619f9bd2568f204b9f579589dd3b79c37092539905121176bd1c9c
|
|
7
|
+
data.tar.gz: 262a054d5b6a81a9b6b8f3101dedf70eff3c90117bc57a22a8e4cdbca65e3ea17a604fee65604291ad8c729fbc9b8002eddfbec1d63c24c35a3f4d58a32b861d
|
data/lib/tina4/migration.rb
CHANGED
|
@@ -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
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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
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.
|
|
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-
|
|
11
|
+
date: 2026-07-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|