') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); OCTO-893: Deprecate Migrator.ignore_tables/ignore_models in favor of DeclareSchema.ignore_tables/ignore_models by ColinDKelley · Pull Request #188 · Invoca/declare_schema · GitHub
Skip to content

OCTO-893: Deprecate Migrator.ignore_tables/ignore_models in favor of DeclareSchema.ignore_tables/ignore_models - #188

Merged
ColinDKelley merged 8 commits into
masterfrom
OCTO-893/deprecate-migrator-ignore-tables
Jul 8, 2026
Merged

OCTO-893: Deprecate Migrator.ignore_tables/ignore_models in favor of DeclareSchema.ignore_tables/ignore_models#188
ColinDKelley merged 8 commits into
masterfrom
OCTO-893/deprecate-migrator-ignore-tables

Conversation

@ColinDKelley

@ColinDKelleyColinDKelley commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds ::DeclareSchema.ignore_tables and ::DeclareSchema.ignore_models as the new public settings for ignoring tables/models during migration generation
  • Deprecates Generators::DeclareSchema::Migration::Migrator.ignore_tables/.ignore_models (kept working via delegate, emits an ActiveSupport::Deprecation warning) using the same pattern already established for default_charset/default_collation
  • Documents both settings in the README
  • Bumps version to 4.1.0 (minor - new backward-compatible API, non-breaking deprecation, nothing removed)

Fixes OCTO-893

Test plan

  • Added #ignore_tables/#ignore_models specs to migrator_spec.rb covering delegation and deprecation warnings (mirrors existing #default_charset/#default_collation specs)
  • Updated the one pre-existing spec that used the now-deprecated setter to avoid deprecation noise
  • Full suite passes: bundle exec rspec (276 examples, 0 failures)
  • No new Rubocop offenses introduced

Made with Cursor

ColinDKelleyand others added 5 commits July 3, 2026 13:08
…ls deprecation
Documents the plan to move the ignore_tables and ignore_models settings
from the internal Migrator class to the public DeclareSchema module,
deprecating the old settings in place (no removal, no major version bump).
Co-authored-by: Cursor <cursoragent@cursor.com>
…recation
Co-authored-by: Cursor <cursoragent@cursor.com>
Move ignore_tables and ignore_models to ::DeclareSchema, following the
same delegate+deprecate pattern already used for default_charset and
default_collation. The Migrator accessors keep working but emit an
ActiveSupport deprecation warning; nothing is removed.
Co-authored-by: Cursor <cursoragent@cursor.com>
Update the README Ignored Tables section to point at the new public
DeclareSchema.ignore_tables setting, and add a new Ignored Models
section documenting DeclareSchema.ignore_models. Both note that the
old Migrator-based settings are deprecated aliases.
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds DeclareSchema.ignore_tables/ignore_models (OCTO-893), deprecating
the old Migrator-based settings without removing them.
Co-authored-by: Cursor <cursoragent@cursor.com>
@ColinDKelley
ColinDKelley requested a review from a team as a code ownerJuly 3, 2026 20:48
@ColinDKelley
ColinDKelley requested review from jebentier and removed request for dcaddellJuly 3, 2026 20:50

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves the ignore_tables / ignore_models configuration from the internal Generators::DeclareSchema::Migration::Migrator class onto the public ::DeclareSchema module, while keeping the old migrator accessors working via delegation and emitting deprecation warnings.

Changes:

  • Added ::DeclareSchema.ignore_tables and ::DeclareSchema.ignore_models as new public configuration settings (defaulting to []).
  • Deprecated Generators::DeclareSchema::Migration::Migrator.ignore_tables / .ignore_models (delegated to ::DeclareSchema and wrapped with ActiveSupport::Deprecation), and updated internal generator code paths to use ::DeclareSchema directly to avoid warning spam.
  • Updated specs + README, and bumped version to 4.1.0 with a matching CHANGELOG entry.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
spec/lib/generators/declare_schema/migration/migrator_spec.rbAdds specs verifying delegation + deprecation warnings for the old Migrator accessors.
spec/lib/declare_schema/migration_generator_spec.rbUpdates integration spec to use the new public ::DeclareSchema.ignore_tables API.
README.mdDocuments DeclareSchema.ignore_tables and adds documentation for DeclareSchema.ignore_models, with deprecation notes for old Migrator APIs.
lib/generators/declare_schema/migration/migrator.rbDelegates + deprecates ignore_tables / ignore_models on Migrator; updates internal callers to ::DeclareSchema.* to avoid warning spam.
lib/declare_schema/version.rbBumps gem version to 4.1.0.
lib/declare_schema.rbIntroduces the new ::DeclareSchema.ignore_tables / ignore_models settings and defaults.
Gemfile.lockUpdates local gem version entry to 4.1.0.
docs/superpowers/specs/2026-07-03-ignore-tables-deprecation-design.mdAdds design documentation for the deprecation/migration approach.
docs/superpowers/plans/2026-07-03-ignore-tables-ignore-models-deprecation.mdAdds an implementation plan documenting steps and rationale.
CHANGELOG.mdAdds a 4.1.0 entry documenting the addition + deprecation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadlib/declare_schema.rb
Comment threadspec/lib/declare_schema/migration_generator_spec.rb
The shared deprecator used by default_charset/default_collation and
the new ignore_tables/ignore_models had a stale '1.0' horizon (already
long past the current 4.1.0). Bump it to 5.0, and update the README to
state explicitly that the deprecated Migrator settings will be removed
in that version.
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment threadlib/declare_schema.rb
Comment threadspec/lib/declare_schema/migration_generator_spec.rb
Validate DeclareSchema.ignore_tables=/ignore_models= inputs (Array or
nil, with nil normalized to []) so a bad value raises a clear
ArgumentError instead of crashing later on .map, matching the
existing validation pattern for other DeclareSchema settings.
Also reset DeclareSchema.ignore_tables after the migration generator
spec that sets it, so the global setting does not leak into later
examples.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ColinDKelley
ColinDKelley requested review from jebentier and removed request for jebentierJuly 8, 2026 15:44
@ColinDKelley
ColinDKelley merged commit 1c2c1b5 into masterJul 8, 2026
47 checks passed
@ColinDKelley
ColinDKelley deleted the OCTO-893/deprecate-migrator-ignore-tables branch July 8, 2026 16:20
Sign up for freeto 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.

3 participants

@ColinDKelley@jebentier