activerecord-virgodb-adapter 0.1.8 → 0.1.9

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: b21e3613bde955c3741ba92692bb2465036783609e4d11f9540ce0283ea83732
4
- data.tar.gz: 34b1d14f797d629a6f09c029d422803353df2d86cb8c0682883bbb90d56fde18
3
+ metadata.gz: c9adcef53b08377de04eaa8a3efb42a9ef26af8c9d21d354417a9431374ffb5b
4
+ data.tar.gz: '089277465d82f97c0075bb1641c46bd37e02a3c44d0e3f627d02962a473bfcfd'
5
5
  SHA512:
6
- metadata.gz: cbafb03b4df28cc059ed39deffd6504916232cb545b4ae2c7bce66e55121837e90cb3a76c8ecc6fd074277665abd6c438042ecce57530a5960b0fc6391a2d314
7
- data.tar.gz: 79aae8c9a8cbcc419ac83295f371d24122cfddf291d5974c473d23cbafa512b3a177109197b86f090c349af594eb1533d47bea3e2bd84e7a2a28fe835d08c02a
6
+ metadata.gz: f7c81193bd344ef5e4120c7147e4374d5421fb17e129937b829bb6f01fcc59ec8e1734916f7c85e2a07ff3b66687a09de0cc361a6489bc85459fb4e086083894
7
+ data.tar.gz: 5df55c10f41ff7fd8264e561e470966fa3b9aadf8e7691304f6ad0d8336fb0939780782df4c03a33b68369f691a357ca70a146261f3f812c891c7c5ada66a2e9
@@ -458,8 +458,8 @@ module ActiveRecord
458
458
  next_version = (select_value("SELECT MAX(version) FROM schema_versions WHERE table_name = #{quote(table_name)}") || 0).to_i + 1
459
459
 
460
460
  execute(<<~SQL)
461
- INSERT INTO schema_versions (table_name, version, columns, applied_at)
462
- VALUES (#{quote(table_name)}, #{next_version}, #{quote(cols.to_json)}, #{Time.now.to_i})
461
+ INSERT INTO schema_versions (table_name, version, columns)
462
+ VALUES (#{quote(table_name)}, #{next_version}, #{quote(cols.to_json)})
463
463
  SQL
464
464
  end
465
465
 
@@ -471,14 +471,21 @@ module ActiveRecord
471
471
  # in manifest/src/lib.rs for why (breaks a real structure_dump/
472
472
  # structure_load round trip the moment any host app's
473
473
  # ActiveRecord::SchemaDumper.ignore_tables is non-empty).
474
+ #
475
+ # No `applied_at` column (removed -- nothing ever read it back, see
476
+ # manifest/src/lib.rs's matching comment on `register_schema_version`).
477
+ # Breaking format change, no in-place migration: `IF NOT EXISTS` is a
478
+ # no-op against a manifest that already has the old `applied_at NOT
479
+ # NULL` shape, so `insert_schema_version!` above would fail against
480
+ # one -- deliberate, pre-production, existing manifests get dropped
481
+ # and recreated rather than migrated.
474
482
  def ensure_schema_versions_table!
475
483
  execute(<<~SQL)
476
484
  CREATE TABLE IF NOT EXISTS schema_versions (
477
485
  id INTEGER PRIMARY KEY,
478
486
  table_name TEXT NOT NULL,
479
487
  version INTEGER NOT NULL,
480
- columns TEXT NOT NULL,
481
- applied_at INTEGER NOT NULL
488
+ columns TEXT NOT NULL
482
489
  )
483
490
  SQL
484
491
  end
@@ -141,21 +141,14 @@ module ActiveRecord
141
141
  # columns against the CURRENT version, which is exactly what's still
142
142
  # dumped.
143
143
  #
144
- # `applied_at` is dumped as a fixed `0`, and no per-version history
145
- # comment is written -- both used to carry real wall-clock data
144
+ # `schema_versions` has no `applied_at` column as of this adapter
145
+ # version (removed from the manifest's own schema, see
146
+ # manifest/src/lib.rs's matching comment on `register_schema_version`
147
+ # -- nothing ever read it back). It used to carry real wall-clock data
146
148
  # (`Time.now.to_i` at migration time), which made this file diff on
147
149
  # every clean rebuild (`db:drop` + `db:migrate`) even when the actual
148
- # schema hadn't changed at all. Confirmed nothing reads either back:
149
- # `current_schema_version` only ever selects `version, columns` (see
150
- # above), and this adapter's own `assert_additive!`/
151
- # `record_added_column!` only ever read `columns` too. The live
152
- # manifest's real `schema_versions` table is untouched by this --
153
- # `applied_at` still gets a real timestamp there at migration time,
154
- # useful for a human inspecting the live table directly. This only
155
- # changes what a fresh `structure_load` seeds into a NEW database,
156
- # where a wall-clock value was never reproducible enough to belong in
157
- # a checked-in file meant to represent "current schema shape," not
158
- # "when someone last regenerated this file."
150
+ # schema hadn't changed at all -- that's gone now along with the
151
+ # column, not just papered over here.
159
152
  def dump_schema_versions!(filename)
160
153
  return unless connection.data_source_exists?("schema_versions")
161
154
 
@@ -169,10 +162,9 @@ module ActiveRecord
169
162
 
170
163
  pretty_columns = JSON.pretty_generate(JSON.parse(latest["columns"]))
171
164
  f.puts(
172
- "INSERT INTO \"schema_versions\" (id, table_name, version, columns, applied_at) VALUES (\n" \
165
+ "INSERT INTO \"schema_versions\" (id, table_name, version, columns) VALUES (\n" \
173
166
  " #{latest['id']}, #{connection.quote(table_name)}, #{latest['version']},\n" \
174
- " #{connection.quote(pretty_columns)},\n" \
175
- " 0\n" \
167
+ " #{connection.quote(pretty_columns)}\n" \
176
168
  ");"
177
169
  )
178
170
  f.puts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-virgodb-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - virgodb