- Improve generating migrations by using migration pool from connection. Thanks Stephen Ierodiaconou for noticing and fixing this!
- Fix compatibility w/ active_type gem and handling anonymous classes. Thanks ojab for fixing this!
- Improving CI. Thanks ojab for doing this!
- Make all models methods ignore database disabled models. Thanks Chedli Bourguiba for fixing it!
- Fix DatabaseConsistencyCheckers/All setting
- Make LengthConstraintChecker ignore Proc/Symbol settings
- Handle lower() index in autofix migration writer
Thanks Alexander Sviridov for fixing all of this!
- EnumValueChecker: Check enums in any order. Thanks Sergey Toy for noticing and improving this!
- Adjust error file. Thanks Andy Allan for reporting this!
- Adjust
ColumnPresenceChecker
to work with ActiveRecord 7.1. Thanks Alex Robbin to create an issue and Chedli Bourguiba for fixing it.
- Ignore models without connected tables. Thanks Francesco for the contribution!
- Ignore disconnected models.
- Implement
ImplicitOrderingChecker
. Thanks Nhan Nim for the contribution!
- Improve
MissingAssociationClassChecker
to work with invalidthrough
associations.
- Output debugging context for found issues.
- Implement
MissingTableChecker
when find a model that is missing its table so it can be either removed completely or fixed.
- Fix
ForeignKeyTypeChecker
when associated class has no table. Thanks Andrius Chamentauskas for fixing the bug!
- Add a new checker
MissingAssociationClassChecker
which finds associations that point to undefined models. Thanks Manuel L. for suggesting the feature! - Fix
ForeignKeyTypeChecker
according toMissingAssociationClassChecker
.
- Add support of disabling checks per database connection. Thanks epidevops for suggesting the feature!
- Add support of regexp for configuration. Thanks Klaus Weidinger for suggesting the feature!
- Fixes
MissingIndexChecker
to consider compound indexes. Thanks Ivan Atanasov for reporting the issue!
- Stops modifying
ActiveRecord::Base.descendants
. Thanks Thierry Deo for fixing the bug!
- Add stable order when generate TODO file. Thanks Olly Chadwick for reporting this!
- Improved specs. Thanks Sergey Toy for taking care of this!
- Fix undefined method error in ColumnPresenceChecker. Thanks Alan Savage for the contribution!
- Fix
ForeignKeyCascadeChecker
by treatingnil
asrestrict
. Thanks Arkadiy Zabazhanov for fixing this! - Add
ThreeStateBooleanChecker
. Thanks Sergey Toy for implementing this!
- Support multiple root-level models for the same table. Thanks Bartek Bułat for improving this!
- Fix removed
File.exists?
. Thanks Dennis Paagman for fixing the issue!
- Improve messaging for
NullConstraintChecker
. Thanks hanzongyu for spotting the issue! - Avoid populating duplicated migrations. Thanks zapxcero for catching the issue!
- Avoid unnecessary deprecations warnings.
- Fix
EnumValueChecker
asenums
are supported by Ruby on Rails 7+. Thanks Sergey Toy for catching and fixing the issue!
Implement CaseSensitiveUniqueValidationChecker
that ensures case insensitive type doesn't have case_sensitive: false
option on unique validations.
- Implement
EnumValueChecker
that ensures consistency between PostgreSQL enum type and ActiveRecord's enum and inclusion validation. Thanks Michal Papis for suggesting this!
- Fix
ColumnPresenceChecker
autofix for polymorphicbelongs_to
associations. Thanks Sergey Toy for catching the issue!
- Fix
-help
option to output correct options. Thanks la-magra for catching the issue!
- Fix
EnumTypeChecker
to consider PostgreSQL enum types. Thanks Sergey Toy for catching the issue!
- Implement
ForeignKeyCascadeChecker
. Thanks Phil Pirozhkov for the suggestion!
- Reduce warnings when
$VERBOSE=true
. Thanks John Yeates for the suggestion! - Avoid missing columns errors for
ColumnPresenceChecker
andEnumTypeChecker
. Thanks John Yeates for the suggestion!
- Implement
EnumTypeChecker
. Thanks Phil Pirozhkov for the suggestion!
- Output loaded configurations for clarity.
- Add fund metadata
Improvements:
- Group similar issues on Simple::Writer.
Improvements:
- Improve Simple::Writer to avoid duplicates. Thanks Phil Pirozhkov for the suggestion!
Improvements:
- Add autofix for
ForeignKeyTypeChecker
. - Add autofix for
MissingIndexChecker
. - Add autofix for
MissingUniqueIndexChecker
Improvements:
- Provide autofix for
RedundantUniqueIndexChecker
.
Fixes:
- Fix unique sorting for autofix.
Improvements:
- Provide autofix for
RedundantIndexChecker
.
Fixes:
- Fix
UniqueIndexChecker
to properly work with associations. Thanks Christos Zisopoulos for catching the issue!
Fixes:
- Fixed non-unique name for ForeignKeyChecker autofix. Thanks Sergey Toy for catching the issue!
Improvements:
- Introduce autofix option for several checkers.
Improvements:
- Catch errors on processors so they don't break the whole run.
Fixes:
- Fix
IndexProcessor
to support multiple databases.
Improvements:
- Add TODO generation.
Improvements:
- Add global configuration support. Now it's possible to disable everything in one line and enable some on demand.
Fixes:
- Fix
ForeignKeyTypeChecker
for newest SQLite.
Support:
- Ruby 2.4 and Ruby 2.5 are removed from CI but they should be still working fine.
Breaking changes:
- The priority of configuration has changed. Please see the configuration file example for details.
Improvements:
- For Ruby 2.7+ ignore models that come from Bundler.
Fixes:
MissingIndexChecker
checks for precise unique indexes forhas_one
associations.
Improvements:
MissingIndexChecker
checks for unique indexes forhas_one
associations.
Fixes:
ForeignKeyChecker
no longer check cases when model is part of another database. Thanks Muhammad Usman for the contribution!
Fixes:
- ColumnPresenceChecker no longer fails on
has_one :something, required: true
.
Improvements:
- Allow aliases in YAML config file for Ruby 3.1. Thanks jlestavel for the contribution!
- Fixed 1.1.8
Improvements:
- Allow
ForeignKeyTypeChecker
to cover smaller types. Thanks Artem Piankov for the contribution!
Improvements:
- Add multiple files configuration support. Thanks Artem Piankov for the contribution!
Improvements:
- Output error message for ColumnPresenceChecker and ForeignKeyTypeChecker instead raising an error when field is missing.
Improvements:
- Extend
NullConstraintChecker
to check required belongs_to associations with explanatory message.
Improvements:
- Fix
BelongsToPresenceChecker
to to be independent from presence validation and rename it toForeignKeyChecker
to better reflect what it does.
Improvements:
- Fix
ColumnPresenceChecker
to check association key columns. Thanks Phil Pirozhkov for the contribution!
Improvements:
- Change the messages structure to always show checker name.
Bugs:
- Check
where
clauses in comparison inRedundantIndexChecker
andRedundantUniqueIndexChecker
.
Improvements:
- Implement
RedundantUniqueIndexChecker
.
Improvements:
- Implement
RedundantIndexChecker
.
Improvements:
- Ignore to ActiveStorage models on configuration template
Improvements:
- Implement
UniqueIndexChecker
. Thanks Pierre Berard for the contribution!
Bugs:
- Fix primary key for different associations for
ForeignKeyTypeChecker
.
Bugs:
- Fix primary key for
ForeignKeyTypeChecker
.
Bugs:
- Fix type casted fields comparison for
MissingUniqueIndexChecker
. Thanks Artem Chubchenko for reporting the issue.
Bugs:
- Remove HABTM support from
ForeignKeyTypeChecker
- Exclude HABTM classes for all checkers
Bug:
- Fix support for custom foreign keys for
ForeignKeyTypeChecker
. Thanks Thierry Deo for the contribution.
Bug:
- Ignore
through
associations forForeignKeyTypeChecker
- Fix column finder for
ForeignKeyTypeChecker
Improvements:
- Introduce
ForeignKeyTypeChecker
.
Improvements:
LengthConstraintChecker
now ignores array columns (PostgreSQL only)
Improvements:
- Consider
on
option forPresenceValidator
as weak forColumnPresenceChecker
- Support relations for
scope
forMissingUniqueIndexChecker
Improvements:
- Add consideration of numericality validator to
NullConstraintChecker
. Thanks Bob Maerten for adding this.
Improvements:
- Introduce
bundle exec database_consistency install
. Thanks goulvench for implementing this.
Improvements:
- Introduce
PrimaryKeyTypeChecker
.
Improvements:
NullConstraintChecker
now considersExclusionValidator
withnil
.
Bug:
- Fix
BelongsToPresenceChecker
to consider onlybelongs_to
associations.
Bug:
- Fix configuration check.
Bug:
- Fix eager loading for Zeitwerk.
Fix:
- Make
ColumnPresenceChecker
to consider group of validators instead one by one. That decreases amount of false negative scenarios.
Improvements:
- Add support of Rails 6
Fix:
- Custom validators won't raise an error
Fix:
bundle exec database_consistency
exits with fail if there was any error- Skip
MissingIndexChecker
when associated model doesn't exist
Fix:
- Ignore non-string columns for
LengthConstraintChecker
Improvements:
- Add support of
LengthConstraintChecker
Fixes:
- Return error code if output contains any failing message
Improvements:
- Add support of compound indexes to
MissingIndexChecker
- Add colored output
- Removed welcome message from execution
Fixes:
- Fix disabling models from checks
Improvements:
- Add support
case_sensitive: false
forMissingUniqueIndexChecker
Improvements:
- Exclude superclasses associations from
MissingIndexChecker
Improvements:
- Change documentation
- Refactor code
Improvements:
- Add message to inspire people to collaborate
- Add
RescueError
to catch possible error
Improvements:
- Skip
NullConstraintChecker
is column has default function - Improve specs to test different databases
Fixes:
- Fix empty configuration file support
- Fix
MissingIndexChecker
, we don't supportthrough
associations for now
Improves:
- Extend configuration to support complete turning off particular checker
Features:
- Introduce
MissingIndexChecker
to find missing indexes forHasOne
andHasMany
associated models.
Improvements:
- Change message templates to be more informative
Features:
- Introduce
MissingUniqueIndexChecker
to find missing unique indexes.
Breaking changes:
- Change schema of the configuration file. Please update to the new version according to the example.
Features:
- Introduce
BelongsToPresenceChecker
to find missing foreign keys.
Breaking changes:
- Rename
PresenceValidationChecker
toColumnPresenceChecker
for simplicity. Please update your configuration files properly.
Features:
- Support flexible configuration (disable specified check for specified column)
Breaking changes:
- Configuration should be provided according to the new format
Improvements:
- Exclude subclasses from ValidatorsProcessor
Features:
- Support of overcommit gem
Improvements:
- Exclude columns with default value from PresenceMissingVerifier
Features:
- Support configurations via yml file
Improvements:
- Exclude Inclusion validator and BelongsTo association from being alerted by PresenceMissingVerifier
Improvements:
- Add support of ActiveRecord 4.2+ (link).
Features:
- Add check of missing presence validator
Features:
- Add check of consistency between presence validator and database field