From ea0b5eab9f9f9e7fd768951c8d367e3f535f4d3e Mon Sep 17 00:00:00 2001 From: Jason Fleetwood-Boldt Date: Tue, 11 Jan 2022 16:20:38 -0500 Subject: [PATCH] v6.5 --- README.md | 7 ++++++- nonschema_migrations.gemspec | 34 ++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8be7c4f..e4817e1 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,17 @@ _Please use the version number of this gem in lockstep with your Rails version._ | Rails 5.2 | | v4.0.2 (Released Jun 2, 2019) | | | Rails 6.0 | | v5.1.2.1 (Released Nov 17, 2021) | | | Rails 7.0.0.alpha2 | | v6.0.alpha2 (Released Nov 17, 2021) | | +| Rails 7 | | v6.5 (Released Jan 11, 2022) | | + ## Introduction Nonschema migrations, also known as data migrations, are a alternative kind of Rails migration. The data migrations operate exactly like schema migrations, except instead of running migrations to make changes to your schema (adding fields, dropping fields, adding tables, etc), you run data migrations to manipulate data in your app, enqueue or execute Resque jobs that require long-running processes. This happens in a Rails app for different reasons, usually to clean up or supplement data or architectural changes. -Splitting your data migrations from your schema migrations has a particular benefit of achieving the most consistent zero-downtime deploys you can. I recommend you switch your deployment script to allow you to do two types of deploys: a Zero-downtime deploy (no schema migrations) and Schema Migration deploy. +Splitting your data migrations from your schema migrations has a particular benefit of achieving the most consistent zero-downtime deploys you can. I recommend you switch your deployment script to allow you to do two +types of deploys: a Zero-downtime deploy (no schema migrations) and Schema Migration deploy. + +You can think of data migrations like seed data for production, staging, and dev environments. It is for people who don't like using seed data in dev, and want to have 'seed-parity' between dev + prod. (For example, for a basic set of setup records.) This way, you can deploy any non-destructive (data-only) migration with a Zero-downtime strategy, and opt to make destructive (schema) migrations in a normal deployment (maintenance on, run schema changes, boot up new app, maintenance off). Data-only migrations can be run while the app is actually running, augmenting what you can achieve with the migration-style shortcuts provided by Rails. diff --git a/nonschema_migrations.gemspec b/nonschema_migrations.gemspec index d3939e0..307c864 100644 --- a/nonschema_migrations.gemspec +++ b/nonschema_migrations.gemspec @@ -1,31 +1,37 @@ require "./lib/nonschema_migrations/version" -Gem::Specification.new do |s| - s.name = 'nonschema_migrations' - s.version = NonSchemaMigrations::VERSION - s.date = Time.now.strftime("%Y-%m-%d") - s.summary = "Nonschema(data-only) migrations for your Rails app" - s.description = "Separate schema-only migrations from nonschema (data) migrations in your Rails app" - s.authors = ["Jason Fleetwood-Boldt"] - s.email = 'code@jasonfb.net' +Gem::Specification.new do |spec| + spec.name = 'nonschema_migrations' + spec.version = NonSchemaMigrations::VERSION + spec.date = Time.now.strftime("%Y-%m-%d") + spec.summary = "Nonschema(data-only) migrations for your Rails app" + spec.description = "Separate schema-only migrations from nonschema (data) migrations in your Rails app" + spec.authors = ["Jason Fleetwood-Boldt"] + spec.email = 'code@jasonfb.net' + spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)}) || f.match(%r{(gemspec|gem)$}) } files end - s.homepage = 'https://github.com/jasonfb/nonschema_migrations' - s.metadata = { "source_code_uri" => "https://github.com/jasonfb/nonschema_migrations", + spec.homepage = 'https://github.com/jasonfb/nonschema_migrations' + + spec.metadata = { "source_code_uri" => "https://github.com/jasonfb/nonschema_migrations", "documentation_uri" => "https://jasonfleetwoodboldt.com/my-open-source-projects/nonschema-migrations/", "homepage_uri" => 'https://heliosdev.shop/'} - s.license = 'MIT' - s.post_install_message = <<~MSG + spec.license = 'MIT' + spec.post_install_message = <<~MSG --------------------------------------------- Welcome to Nonschema Migrations - to set up, please run - + + 1. run set up data migrations: rails generate data_migrations:install + 2. to create a data migration use + rails generate data_migration SetupExampleData + + You can think of data migrations like seed data for production, staging, and dev environments. For support please see https://heliosdev.shop/ ---------------------------------------------