discourse/migrations
Selase Krakani d304e708be
FIX: Stop silently dropping first two rows during load_mapping (#33076)
Currently, the first two rows returned by `DiscourseDB#query_array` are
silently dropped during the column size check in
`DiscourseDB#load_mapping`. This happens because the rows object, while
an enumerator, isn't fully compliant, it doesn't rewind during
introspection. As a result, calls like `#first`, `#peek`, or `#any?`
advance the iterator.

Ideally, we’d fix this by updating the `query_array` enumeration
implementation. However, customizing the enumerator to be fully
compliant would likely introduce unnecessary perf overhead for all use
cases. So, this fix works around that limitation by building the map a
little differently.
2025-06-09 23:26:59 +02:00
..
bin REFACTOR: Code generator for migrations IntemerdiateDB 2025-04-07 17:22:36 +02:00
config FIX: Exclude reviewable_notes from intermediate DB schema (#33068) 2025-06-04 10:31:28 +08:00
db DEV: Require created_at on users (#33033) 2025-06-02 14:08:38 +00:00
docs
lib FIX: Stop silently dropping first two rows during load_mapping (#33076) 2025-06-09 23:26:59 +02:00
scripts/benchmarks REFACTOR: Code generator for migrations IntemerdiateDB 2025-04-07 17:22:36 +02:00
spec DEV: Add converter & importer for permalink_normalizations 2025-05-31 22:17:44 +02:00
.gitignore DEV: Adds a new converter for migrating from Discourse 2025-04-07 17:22:36 +02:00
.rubocop.yml DEV: Refactor migrations-tooling 2025-04-07 17:22:36 +02:00
migrations.rb DEV: Refactor migrations-tooling 2025-04-07 17:22:36 +02:00
README.md DEV: Add converter framework for migrations-tooling (#28540) 2024-09-09 17:14:39 +02:00

Migrations Tooling

Command line interface

./bin/cli help

Converters

Public converters are stored in lib/converters/. If you need to run a private converter, put its code into a subdirectory of private/converters/

Development

Installing gems

bundle config set --local with migrations
bundle install

Updating gems

bundle update --group migrations

Running tests

You need to execute rspec in the root of the project.

bin/rspec --default-path migrations/spec