Skip to content

feat(migrate): automatic v1.5 to v2.x data migration#103

Merged
wrxck merged 1 commit intodevelopfrom
feat/v1-migration
Feb 21, 2026
Merged

feat(migrate): automatic v1.5 to v2.x data migration#103
wrxck merged 1 commit intodevelopfrom
feat/v1-migration

Conversation

@wrxck
Copy link
Owner

@wrxck wrxck commented Feb 21, 2026

Summary

  • Adds src/core/migrate.lua — auto-detects v1.5 Redis keys and configuration.lua on boot, imports all data into v2 PostgreSQL schema
  • Migrates: chat settings, welcome messages, rules, warnings, disabled plugins, filters, triggers, bans, and config
  • Adds migration 007 (sp_upsert_chat_setting_if_missing) for bulk import with ON CONFLICT DO NOTHING
  • Runs once (recorded in schema_migrations), full transaction rollback on failure, negligible overhead on clean installs
  • 41 new busted tests, 0 regressions (709/709 pass)
  • README updated with "Upgrading from v1.5" section

Test plan

  • luacheck src/core/migrate.lua — 0 warnings
  • busted spec/core/migrate_spec.lua — 41/41 pass
  • busted (full suite) — 709/709 pass, 0 regressions
  • Smoke test: boot mattata with no v1 data, verify no migration output

Detects v1.5 installations on boot and imports all data into the v2
PostgreSQL schema: chat settings, welcome messages, rules, warnings,
disabled plugins, filters, triggers, and bans. Converts configuration.lua
to .env format. Runs once, recorded in schema_migrations, with full
transaction rollback on failure.
@wrxck wrxck merged commit 433b0d7 into develop Feb 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant