Description
nullalign is a tool to detect missing non-null constraints in Rails projects.
Nullalign alternatives and similar gems
Based on the "Database Tools" category.
Alternatively, view Nullalign alternatives based on common mentions on social networks and blogs.
-
Database Cleaner
Strategies for cleaning databases in Ruby. Can be used to ensure a clean state for testing. -
Lol DBA
lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts. -
Seed Fu
Advanced seed data handling for Rails, combining the best practices of several methods together. -
Seedbank
Seedbank gives your seed data a little structure. Create seeds for each environment, share seeds between environments and specify dependencies to load your seeds in order. All nicely integrated with simple rake tasks. -
DatabaseConsistency
The tool to avoid various issues due to inconsistencies and inefficiencies between a database schema and application models. -
Polo
Polo travels through your database and creates sample snapshots so you can work with real world data in development. -
SchemaPlus
DISCONTINUED. SchemaPlus provides a collection of enhancements and extensions to ActiveRecord -
Upsert
Upsert on MySQL, PostgreSQL, and SQLite3. Transparently creates functions (UDF) for MySQL and PostgreSQL; on SQLite3, uses INSERT OR IGNORE. -
OnlineMigrations
Catch unsafe PostgreSQL migrations in development and run them easier in production (code helpers for table/column renaming, changing column type, adding columns with default, background migrations, etc). -
Ruby PG Extras
Ruby PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more. -
Slack Smart Bot
Create a Slack bot that is smart and so easy to expand, create new bots on demand, run ruby code on chat, create shortcuts... The main scope of this gem is to be used internally in the company so teams can create team channels with their own bot to help them on their daily work, almost everything is suitable to be automated!! slack-smart-bot can create bots on demand, create shortcuts, run ruby code... just on a chat channel. You can access it just from your mobile phone if you want and run those tests you forgot to run, get the results, restart a server... no limits. -
PgDriveBackup
Simple solution to make encrypted with ccrypt PostgreSQL backups and storing on Google Drive API -
Perfect Shape
Perfect Shape is a collection of geometric algorithms that are mostly useful for GUI manipulation like checking containment of a point in popular geometric shapes such as rectangle, square, arc, circle, polygon, and paths containing lines, quadratic bézier curves, and cubic bezier curves. Also, some general math algorithms like IEEE-754 Remainder. -
ActiveRecord Setops
Union, Intersect, and Difference set operations for ActiveRecord (also, SQL's UnionAll). -
Rapidity
Simple but fast Redis-backed distributed rate limiter. Allows you to specify time interval and count within to limit distributed operations. -
PRY-BYETYPO 👋
A Pry plugin that captures exceptions that may arise from typos and deduces the correct command.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Nullalign or a related project?
README
Nullalign
Description
nullalign is a tool to detect missing non-null constraints in Rails projects.
Suppose you have a validation like this:
validates :email, presence: true
Do you have a non-null constraint in your database to back that up? If not, nullalign will find it for you.
Nullalign is based on Colin Jones' consistency_fail. I mean really really based on it, as in I copied and pasted over a bunch of the code and changed the module and file names. And a lot of this README, too.
Installation
Put this in the development
group in your Gemfile
gem 'nullalign'
Usage
Run it like this:
bundle exec nullalign
Example output
There are presence validators that aren't backed by non-null constraints.
--------------------------------------------------------------------------------
Model Table Columns
--------------------------------------------------------------------------------
Album albums: name, owner_id
AttendanceRecord attendance_records: group_id, attended_at
CheckinLabel checkin_labels: name, xml
CheckinTime checkin_times: campus
Generating a migration
You can also run a Rake task which will generate a migration which will add indexes as needed:
bundle exec rake nullalign:fix
Limitations
nullalign depends on being able to find all your ActiveRecord::Base
subclasses with some $LOAD_PATH
trickery. If any models are in a path either
not on your project's load path or in a path that doesn't include the word
"models", nullalign won't be able to find or analyze them. I'm open to
making the text "models" configurable if people want that. Please open an issue
or pull request if so!
To disable nullalign, I could add a thing that checks column comments for a string like 'nonullalign' if people think that would be useful. Just let me know.
Contributors
- Tom Copeland - author
- Denny Mueller - fix for ActiveStorage compatibility issue
- Woongcheol Yang - support for conditional validations
- Paweł Dąbrowski - Rake task suggestion
Tests
You can run the tests with:
bundle exec rspec
License
Released under the MIT License. See the LICENSE file for further details.
*Note that all licence references and agreements mentioned in the Nullalign README section above
are relevant to that project's source code only.