Skip to content

Output a warning when a Rails migration is run, to request adding documentation to the Intellum data dictionary

Notifications You must be signed in to change notification settings

intellum/db-schema-change-warning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Db Schema Change Warning

This gem outputs a warning when a Rails migration is run in development, to request adding documentation to the Intellum data dictionary.

It should be used by any Intellum application whose data is ingested in the Intellum warehouse.

Installation

Install this gem by adding to Gemfile:

gem "db_schema_change_warning", git: "https://github.com/intellum/db_schema_change_warning"

in the development group and create the config/initializers/warn_on_db_schema_change.rb file with

# Output warning when a new migration changes the DB schema.

if Rails.env.development?
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Migration.prepend(DbSchemaChangeWarning)
  end
end

Local development

To test new changes locally without pushing first to GitHub:

  • checkout the gem GH repo locally
  • do your local changes in the gem directory
  • run gem build db_schema_change_warning.gemspec
  • in your local Exceed repo, change the inclusion of the gem in Gemfile to use gem "db_schema_change_warning", path: "/path/to/your/local/db-schema-change-warning"
  • in your Exceed repo run bundle install
  • create a new migration and run it: rails g migration add_foo_to_users foo and rails db:migrate
  • -> check the output is what you expect

Create a new version and make the applications use this new version

TODO

About

Output a warning when a Rails migration is run, to request adding documentation to the Intellum data dictionary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages