Description
The SchemaPlus family of gems provide various extensions and enhancements to ActiveRecord >= 4.2. There are two varieties:
SchemaPlus alternatives and similar gems
Based on the "Database Tools" category.
Alternatively, view SchemaPlus 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. -
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.
Scout Monitoring - Performance metrics and, now, Logs Management Monitoring with Scout Monitoring
* 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 SchemaPlus or a related project?
README
SchemaPlus family
The SchemaPlus family of gems provide various extensions and enhancements to ActiveRecord >= 4.2. There are two varieties:
Gems that provide new default automatic behavior
These gems run with the spirit of DRY and convention over configuration -- and automatically take care of things for you. Just include any of these gems and they'll get to work.
Gem Description schema_associations DRY up your models! Why manually define associations (and their inverses) in the models, when you've already defined those relations in the database? schema_auto_foreign_keys DRY up your migrations! It goes without saying that a foreign key relationship should have a foreign key constraint -- it should also go without typing. schema_validations DRY up your validations! The database has constraints in it, your models should automatically validate based on those constraints. Gems that extend ActiveRecord's feature set
These gems provide new features and capabilities to ActiveRecord that you may wish to take advantage of. None of these have default automagic; once you include the gem the new features are available, but you need to invoke them to use them.
Gem Description schema_plus_columns Column attributes including column.indexes
andcolumn.unique?
schema_plus_db_default Use ActiveRecord::DB_DEFAULT
to set an attribute to the database defaultschema_plus_default_expr Use SQL expressions for database default values schema_plus_enums Define enum types in migrations schema_plus_foreign_keys Extended support for foreign keys, including creation as column options, :deferrable
, and SQLite3 supportschema_plus_indexes Convenience and consistency in using indexes schema_plus_multischema Support for using multiple PostgreSQL schemas in a single database schema_plus_pg_indexes PostgreSQL index features: case_insensitive
,expression
andoperator_class
schema_plus_tables Convenience and consistency in using tables schema_plus_views Create and drop views in migrations
See detailed documentation in each gem's README.
Is there some other capability you wish SchemaPlus had a gem for? Open an issue here. Or try implementing it yourself -- creating ActiveRecord extensions is easy and fun using SchemaPlus's tools schema_monkey and schema_plus_core!!
The schema_plus
gem
The schema_plus
gem (v2.0) is a wrapper that pulls in a collection of gems from the SchemaPlus family. For the most part we recommend skipping this gem and directly including the specific feature gems you're interested in using.
This wrapper is mostly provided for easy upgrade for those who were using schema_plus v1.8, which was a single monolothic gem. This wrapper pulls in the gems that provide the same set of features and automatic behavior as the previous version:
- schema_auto_foreign_keys
- schema_plus_columns
- schema_plus_db_default
- schema_plus_default_expr
- schema_plus_enums
- schema_plus_foreign_keys
- schema_plus_indexes
- schema_plus_pg_indexes
- schema_plus_tables
- schema_plus_views
Note that the earlier version (1.x) supports earlier versions of ActiveRecord: 3.1, 4.0, 4.1, and 4.2.0. For more info about that version, see the schema_plus 1.x branch README.
Upgrading from schema_plus
1.8.x
schema_plus
2.0 intends to be a completely backwards-compatible drop-in replacement for SchemaPlus 1.8.x, through restricted to ActiveRecord >= 4.2 and Ruby >= 2.1
If you find any incompatibilities, please report an issue!
Deprecations
In cases where ActiveRecord 4.2 has introduced features previously supported only by SchemaPlus, but using different names, the SchemaPlus 2.0 family of gems now issue deprecation warnings in favor of the rails form. The complete list of deprecations:
Index definition deprecates these options:
:conditions
=>:where
:kind
=>:using
drop_table
deprecates this option:cascade: true
=>force: :cascade
Foreign key definitions deprecate options to
:on_update
and:on_delete
::set_null
=>:nullify
add_foreign_key
andremove_foreign_key
deprecate the method signature:(from_table, columns, to_table, primary_keys, options)
=>(from_table, to_table, options)
ForeignKeyDefinition
deprecates accessors:#table_name
in favor of#from_table
#column_names
in favor ofArray.wrap(#column)
#references_column_names
in favor of#primary_key
#references_table_name in favor of
#to_table`
IndexDefinition
deprecates accessors:#conditions
in favor of#where
#kind
in favor of#using.to_s
Compatibility
SchemaPlus 2.x is tested against all combinations of:
<!-- SCHEMA_DEV: MATRIX - begin --> <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
- ruby 2.1.5 with activerecord 4.2.0, using mysql2, sqlite3 or postgresql
- ruby 2.1.5 with activerecord 4.2.1, using mysql2, sqlite3 or postgresql
<!-- SCHEMA_DEV: MATRIX - end -->
Installation
Install from http://rubygems.org via
$ gem install "schema_plus"
or in a Gemfile
gem "schema_plus"
History
See [CHANGELOG](CHANGELOG.md) for per-version release notes.
SchemaPlus was originally derived from several "Red Hill On Rails" plugins created by @harukizaemon
SchemaPlus was created in 2011 by @mlomnicki and @ronen
And lots of contributors since then.
In 2015, the monolithic schema_plus gem was split into the SchemaPlus family of specific feature gems.