ruby-data-migrate-5.3.1/0000755000175000017500000000000013417547664013455 5ustar aleealeeruby-data-migrate-5.3.1/screenshot.png0000644000175000017500000012614613374461640016341 0ustar aleealeePNG  IHDRC|usRGB@IDATx]`E}R! ED+(BBB EPz!*ĂR,PIM̷F &7~ͼy(r 8f><`=zlay80s\9Qc8VG|yz_Os9(g*zgB|,a1:6҅{Tn6=@H N9 *UyQ0>>_ .;}oZ1XXXy@Kp?Ѽ$(b!8c|T{TaS \|3Xnxް>B(ؤIN0XX#vqdBaYE(iMY%b~>U)+&]xoDlBSMi~95#?3XXX<(DZKnXf/Yg=&wv#ovfF ySD#K1`稥MU" Uш̆dvЩ:~NW|`9`9]ʄDu{vA;/?! * c=sx`0mDv`#:aLlh9j<0#):'^+_y:h[P|=|򡲁|M/ k̛3h AQI=E|Z<}ѥXts:r4'йi5r,ު`+2Xд&UmNA'ȥR\^~ApV2!M)`|7 )g1CƮAt/fUbB.+Kt~n:V ,v Cm0[v1*U>(nO4A">aD>) b>g=}JD$pjg! 9S a`}}b+n[44D 23@8ZoS/ ۖҠB)z8]P1YXJ#:D, } ̷fwBE*/+mF]^C~|^֪~gdm^s#*q1j9]DOJ:"H\ԑ>N]|K݆"5bfE`3fsi)f=Ccư멼Zhp#w{qEе'B.I Ԓkg3rF5G4.(JP6 WB@`.FPY!@gϱ)LCcKqrrrrq>ڼP}@xTkz !G~ZsdJRr`~AY~ œ/<9d}s2#@A0c|S"<+_r|`9yz@F@|c$rr# F~RϞF@Jk׾]3_bM1=_| 0b$ {re?1X|F@bϗ=_!,,)IĞo%&A# ieWAyA㐒rP*a1:6^!r|`9yze5lU\3ݞᅥ*OO/3/]:wH|i|`>urrp=AЇ3f<* #e3R_>#0&6K}}ؓQ 14r㻞yS)P&8u&&%WTT"ijaBM^1ĔO`.-?=@%oz/}ͭ7t vֈh>EF(FC(Y,3+}CSߔlJ\띄Ջz_&_LY2^-a||斃2N4%t통kVaפبמ(Ňwt' 'UixS|~? Śt `S I$~Q'g<`=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OQr|>v):Uֶ !F."b%pxkz i)Q?cZ9# ($"!ϳڵ#@t _fm=rZΌž>cm=bQE +֦Ӿ@ݤT&EIӁҵBţл26C휽Q'vlSQCB,JK EAZl+,V8DK6wm>ޑtfg͛7_/Ǜrʒ.N⾂0#_Mɞ!OKPq(wҭv۪_q>.c0w.|[pW> %kGQ#:^yx|Bpd4pIeUB!A%Ze'N\,T)^5=:M HI[+ EZ% s`B+S/u~}y'w7w$^CdĎb XΧiO k4ʝ<ׄ^](%Ciit&~??{Oly9e~T:f*IYO&lչXO-u~{\MFHQV06D(9TcEVkBwmndE lzNj5ZZPJe`I~ Q`Jȑ'PF7n !"U$E+}\ɰqtu($׻'G'>WRqt>J|I~,i/)=oüxuRmqzÃ߃:_tp=Γc|~b 5.1' ruby-data-migrate-5.3.1/data_migrate.gemspec0000644000175000017500000000313613417546235017437 0ustar aleealee# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "data_migrate/version" Gem::Specification.new do |s| s.name = "data_migrate" s.version = DataMigrate::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Andrew J Vargo", "Ilya Katz", "Deborah Enomah"] s.email = ["ajvargo@computer.org", "ilyakatz@gmail.com", "enomaomorogieva@gmail.com"] s.homepage = "https://github.com/ilyakatz/data-migrate" s.summary = %q{Rake tasks to migrate data alongside schema changes.} s.description = %q{Rake tasks to migrate data alongside schema changes.} s.license = "MIT" s.rubyforge_project = "data_migrate" s.add_dependency('rails', '>= 4.2') s.add_development_dependency "appraisal" s.add_development_dependency "rake" s.add_development_dependency "rspec" s.add_development_dependency "rspec-core" s.add_development_dependency "pry" s.add_development_dependency "rb-readline" s.add_development_dependency "sqlite3" s.add_development_dependency "timecop" s.add_development_dependency "rubocop" s.add_development_dependency "overcommit" s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] s.post_install_message = <<-POST_INSTALL_MESSAGE #{"*" * 80} data-migrate: IMPORTANT: Breaking change introduced for migrations from v2. Failure to run the migration can have serious consequences. See Readme for more info. #{"*" * 80} POST_INSTALL_MESSAGE end ruby-data-migrate-5.3.1/.hound.yml0000644000175000017500000000007413417546235015365 0ustar aleealeefail_on_violations: true ruby: config_file: .rubocop.yml ruby-data-migrate-5.3.1/Rakefile0000644000175000017500000000006313374461640015110 0ustar aleealeerequire 'bundler' Bundler::GemHelper.install_tasks ruby-data-migrate-5.3.1/Gemfile.rails50000644000175000017500000000017013374461640016133 0ustar aleealeesource "http://rubygems.org" # Specify your gem's dependencies in data_migrate.gemspec gemspec gem 'rails', '~> 5.0.0' ruby-data-migrate-5.3.1/gemfiles/0000755000175000017500000000000013417546235015241 5ustar aleealeeruby-data-migrate-5.3.1/gemfiles/rails_4.1.gemfile0000644000175000017500000000016113374461640020263 0ustar aleealee# This file was generated by Appraisal source "http://rubygems.org" gem "rails", "4.1.16" gemspec path: "../" ruby-data-migrate-5.3.1/gemfiles/rails_5.0.gemfile0000644000175000017500000000016013374461640020262 0ustar aleealee# This file was generated by Appraisal source "http://rubygems.org" gem "rails", "5.0.3" gemspec path: "../" ruby-data-migrate-5.3.1/gemfiles/rails_5.2.gemfile0000644000175000017500000000016313417546235020271 0ustar aleealee# This file was generated by Appraisal source "http://rubygems.org" gem "rails", "~> 5.2.0" gemspec path: "../" ruby-data-migrate-5.3.1/gemfiles/rails_4.2.gemfile0000644000175000017500000000021213374461640020261 0ustar aleealee# This file was generated by Appraisal source "http://rubygems.org" gem "rails", "4.2.8" gem "nokogiri", "1.6.8.1" gemspec path: "../" ruby-data-migrate-5.3.1/gemfiles/rails_5.1.gemfile0000644000175000017500000000015613374461640020270 0ustar aleealee# This file was generated by Appraisal source "http://rubygems.org" gem "rails", "5.1" gemspec path: "../" ruby-data-migrate-5.3.1/spec/0000755000175000017500000000000013417546235014400 5ustar aleealeeruby-data-migrate-5.3.1/spec/generators/0000755000175000017500000000000013374461640016547 5ustar aleealeeruby-data-migrate-5.3.1/spec/generators/data_migration/0000755000175000017500000000000013374461640021531 5ustar aleealeeruby-data-migrate-5.3.1/spec/generators/data_migration/data_migration_generator_spec.rb0000644000175000017500000000206013374461640030116 0ustar aleealeerequire 'spec_helper' require 'rails/generators' require 'rails/generators/migration' require 'generators/data_migration/data_migration_generator' describe DataMigrate::Generators::DataMigrationGenerator do let(:subject) { DataMigrate::Generators::DataMigrationGenerator } describe :next_migration_number do it "next migration" do Timecop.freeze("2016-12-03 22:15:26 -0800") do expect(ActiveRecord::Base).to receive(:timestamped_migrations) { true } expect(subject.next_migration_number(1)).to eq("20161204061526") end end end describe :migration_base_class_name do let(:subject) { DataMigrate::Generators::DataMigrationGenerator.new(['my_migration']) } it "returns the correct base class name" do if ActiveRecord.version >= Gem::Version.new('5.0') expect(subject.send(:migration_base_class_name)).to eq("ActiveRecord::Migration[#{ActiveRecord::Migration.current_version}]") else expect(subject.send(:migration_base_class_name)).to eq('ActiveRecord::Migration') end end end end ruby-data-migrate-5.3.1/spec/spec_helper.rb0000644000175000017500000000051513417546235017217 0ustar aleealeerequire 'rspec' require 'rails' require 'data_migrate' require 'pry' require 'timecop' if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR == 2 DataMigrate::DataMigrator.migrations_paths = ["spec/db/data"] end RSpec.configure do |config| config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end end ruby-data-migrate-5.3.1/spec/data_migrate/0000755000175000017500000000000013417546235017021 5ustar aleealeeruby-data-migrate-5.3.1/spec/data_migrate/config_spec.rb0000644000175000017500000000110013417546235021615 0ustar aleealeerequire "spec_helper" describe DataMigrate::Config do it "sets default data_migrations_path path" do expect(DataMigrate.config.data_migrations_path).to eq "db/data/" end describe "data migration path configured" do before do DataMigrate.configure do |config| config.data_migrations_path = "db/awesome/" end end after do DataMigrate.configure do |config| config.data_migrations_path = "db/data/" end end it do expect(DataMigrate.config.data_migrations_path).to eq "db/awesome/" end end end ruby-data-migrate-5.3.1/spec/data_migrate/data_schema_migration_spec.rb0000644000175000017500000000062713374461640024665 0ustar aleealeerequire 'spec_helper' describe DataMigrate::DataSchemaMigration do let(:subject) { DataMigrate::DataSchemaMigration } describe :table_name do it "returns correct table name" do expect(subject.table_name).to eq("data_migrations") end end describe :index_name do it "returns correct index name" do expect(subject.index_name).to eq("unique_data_migrations") end end end ruby-data-migrate-5.3.1/spec/data_migrate/database_tasks_spec.rb0000644000175000017500000000611713417546235023336 0ustar aleealee# frozen_string_literal: true require "spec_helper" describe DataMigrate::DatabaseTasks do let(:subject) { DataMigrate::DatabaseTasks } let(:migration_path) { if Rails::VERSION::MAJOR == 5 if Rails::VERSION::MINOR == 2 "spec/db/migrate/5.2" else "spec/db/migrate/5.0" end else "spec/db/migrate/4.2" end } let(:data_migrations_path) { if Rails::VERSION::MAJOR == 5 if Rails::VERSION::MINOR == 2 "spec/db/data" else "spec/db/5.0" end else "spec/db/4.2" end } let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end before do # In a normal Rails installation, db_dir would defer to # Rails.application.config.paths["db"].first # @see https://github.com/rails/rails/blob/a7d49ef78c36df2d1ca876451f30915ada1079a5/activerecord/lib/active_record/tasks/database_tasks.rb#L54 allow(subject).to receive(:db_dir).and_return("db") end before do allow(DataMigrate::Tasks::DataMigrateTasks).to receive(:migrations_paths) { data_migrations_path } allow(DataMigrate::DataMigrator).to receive(:db_config) { db_config } ActiveRecord::Base.establish_connection(db_config) end describe :schema_file do it "returns the correct data schema file path" do expect(subject.schema_file(nil)).to eq "db/data_schema.rb" end end context "migrations" do after do begin ActiveRecord::Migration.drop_table("data_migrations") rescue ActiveRecord::StatementInvalid end ActiveRecord::Migration.drop_table("schema_migrations") end before do ActiveRecord::Base.establish_connection(db_config) ActiveRecord::SchemaMigration.create_table allow(DataMigrate::SchemaMigration).to receive(:migrations_paths) { migration_path } allow(DataMigrate::DatabaseTasks).to receive(:data_migrations_path) { data_migrations_path }.at_least(:once) allow(DataMigrate::DatabaseTasks).to receive(:schema_migrations_path) { migration_path }.at_least(:once) end describe :past_migrations do it do subject.forward m = subject.past_migrations expect(m.count).to eq 1 expect(m.first[:version]).to eq 20091231235959 end it "shows nothing without any migrations" do m = subject.past_migrations expect(m.count).to eq 0 end end describe :forward do it "run forward default amount of times" do subject.forward versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(1) end it "run forward defined number of times" do subject.forward(2) versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(1) expect(versions.first).to eq "20091231235959" versions = ActiveRecord::SchemaMigration.normalized_versions expect(versions.count).to eq(1) expect(versions.first).to eq "20131111111111" end end end end ruby-data-migrate-5.3.1/spec/data_migrate/schema_migration_spec.rb0000644000175000017500000000337413417546235023700 0ustar aleealee# frozen_string_literal: true require "spec_helper" describe DataMigrate::SchemaMigration do let(:migration_path) { if Rails::VERSION::MAJOR == 5 if Rails::VERSION::MINOR == 2 "spec/db/migrate/5.2" else "spec/db/migrate/5.0" end else "spec/db/migrate/4.2" end } let(:subject) { DataMigrate::SchemaMigration } let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end let(:fixture_file_timestamps) do %w[20091231235959 20101231235959 20111231235959] end before do ActiveRecord::Base.establish_connection(db_config) ActiveRecord::SchemaMigration.create_table end after do ActiveRecord::Migration.drop_table("schema_migrations") end describe :pending_schema_migrations do it "list sorted schema migrations" do expect(subject).to receive(:migrations_paths) { migration_path } migrations = subject.pending_schema_migrations expect(migrations.count).to eq 2 expect(migrations[0][:version]).to eq(20131111111111) expect(migrations[1][:version]).to eq(20202020202011) end end describe :run do it do expect { subject.run(:up, migration_path, 20202020202011) }.to output(/20202020202011 DbMigration: migrating/).to_stdout versions = ActiveRecord::SchemaMigration.normalized_versions expect(versions.first).to eq("20202020202011") end it "undo migration" do subject.run(:up, migration_path, 20202020202011) expect { subject.run(:down, migration_path, 20202020202011) }.to output(/Undoing DbMigration/).to_stdout versions = ActiveRecord::SchemaMigration.normalized_versions expect(versions.count).to eq(0) end end end ruby-data-migrate-5.3.1/spec/data_migrate/data_migrator_spec.rb0000644000175000017500000000431013417546235023173 0ustar aleealeerequire "spec_helper" describe DataMigrate::DataMigrator do let(:subject) { DataMigrate::DataMigrator } let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end describe :load_migrated do before do allow(subject).to receive(:db_config) { db_config }.at_least(:once) ActiveRecord::Base.establish_connection(db_config) ::ActiveRecord::SchemaMigration.create_table DataMigrate::DataSchemaMigration.create_table end after do ActiveRecord::Migration.drop_table("data_migrations") ActiveRecord::Migration.drop_table("schema_migrations") end it do subject.assure_data_schema_table DataMigrate::DataSchemaMigration.create(version: 20090000000000) ::ActiveRecord::SchemaMigration.create(version: 20100000000000) DataMigrate::DataSchemaMigration.create(version: 20110000000000) ::ActiveRecord::SchemaMigration.create(version: 20120000000000) migrated = subject.new(:up, []).load_migrated expect(migrated.count).to eq 2 expect(migrated).to include 20090000000000 expect(migrated).to include 20110000000000 end end describe :assure_data_schema_table do before do allow(subject).to receive(:db_config) { db_config }.at_least(:once) ActiveRecord::Base.establish_connection(db_config) end after do ActiveRecord::Migration.drop_table("data_migrations") end it do expect( ActiveRecord::Base.connection.table_exists?("data_migrations") ).to eq false subject.assure_data_schema_table expect( ActiveRecord::Base.connection.table_exists?("data_migrations") ).to eq true end end describe :match do context "when the file does not match" do it "returns nil" do expect(subject.match("not_a_data_migration_file")).to be_nil end end context "when the file matches" do it "returns a valid MatchData object" do match_data = subject.match("20091231235959_some_name.rb") expect(match_data[0]).to eq "20091231235959_some_name.rb" expect(match_data[1]).to eq "20091231235959" expect(match_data[2]).to eq "some_name" end end end end ruby-data-migrate-5.3.1/spec/data_migrate/migration.rb0000644000175000017500000000073513374461640021342 0ustar aleealeerequire 'spec_helper' if Rails::VERSION::MAJOR >= 5 subject = DataMigrate::MigrationFive else subject = DataMigrate::Migration end describe subject do it "uses correct table name" do expect(subject.table_name).to eq("data_migrations") end it "uses correct index name" do expect(subject).to receive(:table_name_prefix) { "" } expect(subject).to receive(:table_name_suffix) { "" } expect(subject.index_name).to eq("unique_data_migrations") end end ruby-data-migrate-5.3.1/spec/data_migrate/schema_dumper_spec.rb0000644000175000017500000000243213417546235023175 0ustar aleealee# frozen_string_literal: true require "spec_helper" describe DataMigrate::SchemaDumper do let(:subject) { DataMigrate::SchemaDumper } let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end let(:fixture_file_timestamps) do %w[20091231235959 20101231235959 20111231235959] end describe :dump do before do allow(DataMigrate::DataMigrator). to receive(:db_config) { db_config }.at_least(:once) ActiveRecord::Base.establish_connection(db_config) ActiveRecord::SchemaMigration.create_table DataMigrate::DataMigrator.assure_data_schema_table ActiveRecord::Base.connection.execute <<-SQL INSERT INTO #{DataMigrate::DataSchemaMigration.table_name} VALUES #{fixture_file_timestamps.map { |t| "(#{t})" }.join(', ')} SQL end after do ActiveRecord::Migration.drop_table("data_migrations") end it "writes the define method with the version key to the stream" do stream = StringIO.new DataMigrate::SchemaDumper.dump(ActiveRecord::Base.connection, stream) stream.rewind last_version = fixture_file_timestamps.last expected = "DataMigrate::Data.define(version: #{last_version})" expect(stream.read).to include expected end end end ruby-data-migrate-5.3.1/spec/data_migrate/legacy_migrator_spec.rb0000644000175000017500000000252113417546235023530 0ustar aleealeerequire "spec_helper" describe DataMigrate::LegacyMigrator do let(:context) { DataMigrate::MigrationContext.new("spec/db/data") } after do begin ActiveRecord::Migration.drop_table("data_migrations") ActiveRecord::Migration.drop_table("schema_migrations") rescue StandardError nil end end before do ActiveRecord::Base.establish_connection(db_config) ActiveRecord::SchemaMigration.create_table DataMigrate::DataSchemaMigration.create_table end let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end it "migrate legacy migrations to be in correct table" do DataMigrate::DataSchemaMigration.create_table # simulate creation of legacy data migration when # it was recorded in schema table ActiveRecord::SchemaMigration.create(version: "20091231235959") # create one migration in correct place DataMigrate::DataSchemaMigration.create(version: "20171231235959") migrated = DataMigrate::DataMigrator .new(:up, []).load_migrated expect(migrated.count).to eq 1 DataMigrate::LegacyMigrator.new("spec/db/data").migrate # after migacy migrator has been run, we should have records # of both migrations migrated = DataMigrate::DataMigrator .new(:up, []).load_migrated expect(migrated.count).to eq 2 end end ruby-data-migrate-5.3.1/spec/data_migrate/data_spec.rb0000644000175000017500000000442013417546235021271 0ustar aleealee# frozen_string_literal: true require "spec_helper" describe DataMigrate::Data do let(:subject) { DataMigrate::Data } let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end let(:fixture_file_timestamps) do %w[20091231235959 20101231235959 20111231235959] end around do |example| Dir.mktmpdir do |temp_dir| @temp_dir = temp_dir # create the fake data migration files fixture_file_timestamps.each do |timestamp| FileUtils.touch File.join(temp_dir, "#{timestamp}_data_migration.rb") end example.run end end describe :define do before do allow(DataMigrate::DataMigrator). to receive(:db_config) { db_config } end after do ActiveRecord::Migration.drop_table("data_migrations") end context "when no version is supplied" do it "returns nil" do expect(subject.define(version: nil)).to be_nil end end context "when a version is supplied" do before do allow(DataMigrate::DataMigrator). to receive(:full_migrations_path).and_return(@temp_dir) end it "sets the current version to the supplied version" do version = fixture_file_timestamps[1] expect(DataMigrate::DataMigrator.current_version).not_to eq version.to_i subject.define(version: version) expect(DataMigrate::DataMigrator.current_version).to eq version.to_i end it "creates entries for migration versions that come " \ "before the supplied version" do version = fixture_file_timestamps[1] subject.define(version: version) sql_select = <<-SQL SELECT version FROM #{DataMigrate::DataSchemaMigration.table_name} SQL db_list_data = ActiveRecord::Base.connection. select_values(sql_select).map(&:to_i) expect(db_list_data).to match_array( [fixture_file_timestamps[0], fixture_file_timestamps[1]].map(&:to_i) ) # The last remaining migration (fixture_file_timestamps[2]) was # not included as part of the supplied version and so should not # appear in the data_migrations table. expect(db_list_data).not_to include(fixture_file_timestamps[2]) end end end end ruby-data-migrate-5.3.1/spec/data_migrate/tasks/0000755000175000017500000000000013417546235020146 5ustar aleealeeruby-data-migrate-5.3.1/spec/data_migrate/tasks/data_migrate_tasks_spec.rb0000644000175000017500000000231113417546235025330 0ustar aleealee# frozen_string_literal: true require "spec_helper" describe DataMigrate::Tasks::DataMigrateTasks do let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end before do if Rails::VERSION::MAJOR == 5 if Rails::VERSION::MINOR == 2 allow(DataMigrate::Tasks::DataMigrateTasks).to receive(:migrations_paths) { "spec/db/data" } else allow(DataMigrate::Tasks::DataMigrateTasks).to receive(:migrations_paths) { "spec/db/5.0" } end else allow(DataMigrate::Tasks::DataMigrateTasks).to receive(:migrations_paths) { "spec/db/4.2" } end allow(DataMigrate::DataMigrator).to receive(:db_config) { db_config } ActiveRecord::Base.establish_connection(db_config) end after do ActiveRecord::Migration.drop_table("data_migrations") end describe :migrate do it do expect { DataMigrate::Tasks::DataMigrateTasks.migrate }.to output(/20091231235959 SomeName: migrating/).to_stdout end it do expect { DataMigrate::Tasks::DataMigrateTasks.migrate }.to output(/20171231235959 SuperUpdate: migrating/).to_stdout end end end ruby-data-migrate-5.3.1/spec/data_migrate/status_service_spec.rb0000644000175000017500000000550213417546235023425 0ustar aleealee# frozen_string_literal: true require "spec_helper" describe DataMigrate::StatusService do let(:subject) { DataMigrate::SchemaDumper } let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end let(:service) { DataMigrate::StatusService } context "table does not exists" do before do ActiveRecord::Base.establish_connection(db_config) end it "show error message" do allow_any_instance_of(service).to receive(:table_name) { "bogus"} stream = StringIO.new service.dump(ActiveRecord::Base.connection, stream) stream.rewind expected = "Data migrations table does not exist" expect(stream.read).to include expected end end context "table exists" do let(:fixture_file_timestamps) do %w[20091231235959 20101231235959 20111231235959] end before do allow(DataMigrate::DataMigrator). to receive(:db_config) { db_config }.at_least(:once) ActiveRecord::Base.establish_connection(db_config) ActiveRecord::SchemaMigration.create_table DataMigrate::DataMigrator.assure_data_schema_table ActiveRecord::Base.connection.execute <<-SQL INSERT INTO #{DataMigrate::DataSchemaMigration.table_name} VALUES #{fixture_file_timestamps.map { |t| "(#{t})" }.join(', ')} SQL allow_any_instance_of(service).to receive(:root_folder) { "spec" } end after do ActiveRecord::Migration.drop_table("data_migrations") end it "shows successfully executed migration" do stream = StringIO.new service.dump(ActiveRecord::Base.connection, stream) stream.rewind expected = " up 20091231235959 Some name" expect(stream.read).to include expected end it "excludes files without .rb extension" do stream = StringIO.new service.dump(ActiveRecord::Base.connection, stream) stream.rewind expected = "20181128000207 Excluded file" expect(stream.read).to_not include expected end it "shows missing file migration" do stream = StringIO.new service.dump(ActiveRecord::Base.connection, stream) stream.rewind expected = " up 20101231235959 ********** NO FILE **********" s = stream.read expect(s).to include expected end it "shows migration that has not run yet" do stream = StringIO.new service.dump(ActiveRecord::Base.connection, stream) stream.rewind expected = " down 20171231235959 Super update" s = stream.read expect(s).to include expected end it "outputs migrations in chronological order" do stream = StringIO.new service.dump(ActiveRecord::Base.connection, stream) stream.rewind s = stream.read expect(s.index("20091231235959")).to be < s.index("20111231235959") end end end ruby-data-migrate-5.3.1/spec/data_migrate/migration_context_spec.rb0000644000175000017500000000676213417546235024130 0ustar aleealeerequire "spec_helper" describe DataMigrate::DataMigrator do let(:context) { DataMigrate::MigrationContext.new("spec/db/data") } let(:schema_context) { ActiveRecord::MigrationContext.new("spec/db/migrate/5.2") } before do unless Rails::VERSION::MAJOR == 5 and Rails::VERSION::MINOR == 2 skip("Tests are only applicable for Rails 5.2") end end after do begin ActiveRecord::Migration.drop_table("data_migrations") ActiveRecord::Migration.drop_table("schema_migrations") rescue StandardError nil end end let(:db_config) do { adapter: "sqlite3", database: "spec/db/test.db" } end describe :migrate do before do ActiveRecord::Base.establish_connection(db_config) ActiveRecord::SchemaMigration.create_table end after do ActiveRecord::Migration.drop_table("data_migrations") ActiveRecord::Migration.drop_table("schema_migrations") end it "migrates existing file" do context.migrate(nil) context.migrations_status versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(2) expect(versions).to include("20091231235959") expect(versions).to include("20171231235959") end it "undo migration" do context.migrate(nil) context.run(:down, 20171231235959) versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(1) expect(versions).to include("20091231235959") end it "does not do anything if migration is undone twice" do context.migrate(nil) expect { context.run(:down, 20171231235959) }.to output(/Undoing SuperUpdate/).to_stdout expect { context.run(:down, 20171231235959) }.not_to output(/Undoing SuperUpdate/).to_stdout end it "runs a specific migration" do context.run(:up, 20171231235959) versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(1) expect(versions).to include("20171231235959") end it "does not do anything if migration is ran twice" do expect { context.run(:up, 20171231235959) }.to output(/Doing SuperUpdate/).to_stdout expect { context.run(:down, 20171231235959) }.not_to output(/Doing SuperUpdate/).to_stdout end it "alerts for an invalid specific migration" do expect { context.run(:up, 201712312) }.to raise_error( ActiveRecord::UnknownMigrationVersionError, /No migration with version number 201712312/ ) end it "rolls back latest migration" do context.migrate(nil) expect { context.rollback }.to output(/Undoing SuperUpdate/).to_stdout versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(1) expect(versions).to include("20091231235959") end it "rolls back 2 migrations" do context.migrate(nil) schema_context.migrate(nil) expect { context.rollback(2) }.to output(/Undoing SomeName/).to_stdout versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(0) end it "rolls back 2 migrations" do context.migrate(nil) expect { context.rollback(2) }.to output(/Undoing SomeName/).to_stdout versions = DataMigrate::DataSchemaMigration.normalized_versions expect(versions.count).to eq(0) end end end ruby-data-migrate-5.3.1/spec/db/0000755000175000017500000000000013417546235014765 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/4.2/0000755000175000017500000000000013417546235015270 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/4.2/20091231235959_some_name.rb0000644000175000017500000000023413417546235021241 0ustar aleealeeclass SomeName < ActiveRecord::Migration def up puts "Doing data migration" end def down raise ActiveRecord::IrreversibleMigration end end ruby-data-migrate-5.3.1/spec/db/4.2/20171231235959_super_update.rb0000644000175000017500000000023713417546235022000 0ustar aleealeeclass SuperUpdate < ActiveRecord::Migration def up puts "Doing data migration" end def down raise ActiveRecord::IrreversibleMigration end end ruby-data-migrate-5.3.1/spec/db/migrate/0000755000175000017500000000000013417546235016415 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/migrate/4.2/0000755000175000017500000000000013417546235016720 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/migrate/4.2/20202020202011_db_migration.rb0000644000175000017500000000022213417546235023314 0ustar aleealeeclass DbMigration < ActiveRecord::Migration def up puts "Doing schema migration" end def down puts "Undoing DbMigration" end end ruby-data-migrate-5.3.1/spec/db/migrate/4.2/20131111111111_late_migration.rb0000644000175000017500000000023213417546235023657 0ustar aleealeeclass LateMigration < ActiveRecord::Migration def up puts "Doing schema LateMigration" end def down puts "Undoing LateMigration" end end ruby-data-migrate-5.3.1/spec/db/migrate/5.2/0000755000175000017500000000000013417546235016721 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/migrate/5.2/20202020202011_db_migration.rb0000644000175000017500000000022713417546235023322 0ustar aleealeeclass DbMigration < ActiveRecord::Migration[5.2] def up puts "Doing schema migration" end def down puts "Undoing DbMigration" end end ruby-data-migrate-5.3.1/spec/db/migrate/5.2/20131111111111_late_migration.rb0000644000175000017500000000023713417546235023665 0ustar aleealeeclass LateMigration < ActiveRecord::Migration[5.2] def up puts "Doing schema LateMigration" end def down puts "Undoing LateMigration" end end ruby-data-migrate-5.3.1/spec/db/migrate/5.0/0000755000175000017500000000000013417546235016717 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/migrate/5.0/20202020202011_db_migration.rb0000644000175000017500000000022713417546235023320 0ustar aleealeeclass DbMigration < ActiveRecord::Migration[5.0] def up puts "Doing schema migration" end def down puts "Undoing DbMigration" end end ruby-data-migrate-5.3.1/spec/db/migrate/5.0/20131111111111_late_migration.rb0000644000175000017500000000023713417546235023663 0ustar aleealeeclass LateMigration < ActiveRecord::Migration[5.0] def up puts "Doing schema LateMigration" end def down puts "Undoing LateMigration" end end ruby-data-migrate-5.3.1/spec/db/data/0000755000175000017500000000000013417546235015676 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/data/20091231235959_some_name.rb0000644000175000017500000000021713417546235021650 0ustar aleealeeclass SomeName < ActiveRecord::Migration[5.2] def up puts "Doing data migration" end def down puts "Undoing SomeName" end end ruby-data-migrate-5.3.1/spec/db/data/20171231235959_super_update.rb0000644000175000017500000000022213417546235022400 0ustar aleealeeclass SuperUpdate < ActiveRecord::Migration[5.2] def up puts "Doing SuperUpdate" end def down puts "Undoing SuperUpdate" end end ruby-data-migrate-5.3.1/spec/db/data/20181128000207_excluded_file.rb.other_ext0000644000175000017500000000003713417546235024456 0ustar aleealee# This file should be excluded ruby-data-migrate-5.3.1/spec/db/5.0/0000755000175000017500000000000013417546235015267 5ustar aleealeeruby-data-migrate-5.3.1/spec/db/5.0/20091231235959_some_name.rb0000644000175000017500000000024113417546235021236 0ustar aleealeeclass SomeName < ActiveRecord::Migration[5.0] def up puts "Doing data migration" end def down raise ActiveRecord::IrreversibleMigration end end ruby-data-migrate-5.3.1/spec/db/5.0/20171231235959_super_update.rb0000644000175000017500000000024413417546235021775 0ustar aleealeeclass SuperUpdate < ActiveRecord::Migration[5.0] def up puts "Doing data migration" end def down raise ActiveRecord::IrreversibleMigration end end ruby-data-migrate-5.3.1/.ruby-style.yml0000644000175000017500000010662213417546235016375 0ustar aleealeeAllCops: TargetRubyVersion: 2.4 Include: - "**/*.podspec" - "**/*.jbuilder" - "**/*.rake" - "**/*.opal" - "**/Gemfile" - "**/Rakefile" - "**/Capfile" - "**/Guardfile" - "**/Podfile" - "**/Thorfile" - "**/Vagrantfile" - "**/Berksfile" - "**/Cheffile" - "**/Vagabondfile" Exclude: - "**/*.gemspec" - "vendor/**/*" - "**/schema.rb" - "db/migrate/*" - "db/data/*" - "db/data_schema.rb" - "tasks/databases.rake" Rails/Date: EnforcedStyle: strict Style/FrozenStringLiteralComment: Enabled: false Layout/AccessModifierIndentation: Description: Check indentation of private/protected visibility modifiers. StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected Enabled: true EnforcedStyle: indent SupportedStyles: - outdent - indent Layout/AlignHash: Description: Align the elements of a hash literal if they span more than one line. Enabled: true EnforcedHashRocketStyle: key EnforcedColonStyle: key EnforcedLastArgumentHashStyle: always_inspect SupportedLastArgumentHashStyles: - always_inspect - always_ignore - ignore_implicit - ignore_explicit Layout/AlignParameters: Description: Align the parameters of a method call if they span more than one line. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent Enabled: true EnforcedStyle: with_first_parameter SupportedStyles: - with_first_parameter - with_fixed_indentation Style/AndOr: Description: Use &&/|| instead of and/or. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or Enabled: false EnforcedStyle: always SupportedStyles: - always - conditionals Style/BarePercentLiterals: Description: Checks if usage of %() or %Q() matches configuration. StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand Enabled: true EnforcedStyle: bare_percent SupportedStyles: - percent_q - bare_percent Style/BracesAroundHashParameters: Description: Enforce braces style around hash parameters. Enabled: false EnforcedStyle: no_braces SupportedStyles: - braces - no_braces - context_dependent Layout/CaseIndentation: Description: Indentation of when in a case/when/[else/]end. StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case Enabled: true EnforcedStyle: case SupportedStyles: - case - end IndentOneStep: false Style/ClassAndModuleChildren: Description: Checks style of children classes and modules. Enabled: false EnforcedStyle: nested SupportedStyles: - nested - compact Style/ClassCheck: Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`. Enabled: true EnforcedStyle: is_a? SupportedStyles: - is_a? - kind_of? Style/CollectionMethods: Description: Preferred collection methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size Enabled: false PreferredMethods: collect: map collect!: map! find: detect find_all: select reduce: inject Style/CommentAnnotation: Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW). StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords Enabled: false Keywords: - TODO - FIXME - OPTIMIZE - HACK - REVIEW Layout/MultilineMethodCallIndentation: EnforcedStyle: indented Enabled: true SupportedStyles: - aligned - indented - indented_relative_to_receiver Layout/DotPosition: Description: Checks the position of the dot in multi-line method calls. StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains Enabled: false EnforcedStyle: leading SupportedStyles: - leading - trailing Layout/EmptyLineBetweenDefs: Description: Use empty lines between defs. StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods Enabled: true AllowAdjacentOneLineDefs: false Layout/EmptyLinesAroundBlockBody: Description: Keeps track of empty lines around block bodies. Enabled: false EnforcedStyle: no_empty_lines SupportedStyles: - empty_lines - no_empty_lines Layout/EmptyLinesAroundClassBody: Description: Keeps track of empty lines around class bodies. Enabled: false EnforcedStyle: no_empty_lines SupportedStyles: - empty_lines - no_empty_lines Layout/EmptyLinesAroundModuleBody: Description: Keeps track of empty lines around module bodies. Enabled: true EnforcedStyle: no_empty_lines SupportedStyles: - empty_lines - no_empty_lines Style/Encoding: Description: Use UTF-8 as the source file encoding. StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8 Enabled: false Naming/FileName: Description: Use snake_case for source file names. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files Enabled: false Exclude: [] Layout/FirstParameterIndentation: Description: Checks the indentation of the first parameter in a method call. Enabled: true EnforcedStyle: special_for_inner_method_call_in_parentheses SupportedStyles: - consistent - special_for_inner_method_call - special_for_inner_method_call_in_parentheses Style/For: Description: Checks use of for or each in multiline loops. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops Enabled: true EnforcedStyle: each SupportedStyles: - for - each Style/FormatString: Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%. StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf Enabled: false EnforcedStyle: format SupportedStyles: - format - sprintf - percent Style/GlobalVars: Description: Do not introduce global variables. StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars Enabled: false AllowedVariables: [] Style/GuardClause: Description: Check for conditionals that can be replaced with guard clauses StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals Enabled: false MinBodyLength: 1 Style/HashSyntax: Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.' StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals Enabled: true EnforcedStyle: ruby19 SupportedStyles: - ruby19 - hash_rockets Style/IdenticalConditionalBranches: Description: >- Checks that conditional statements do not have an identical line at the end of each branch, which can validly be moved out of the conditional. Enabled: true Style/IfInsideElse: Description: 'Finds if nodes inside else, which can be converted to elsif.' Enabled: true Style/IfUnlessModifier: Description: >- Favor modifier if/unless usage when you have a single-line body. StyleGuide: '#if-as-a-modifier' Enabled: false Style/IfUnlessModifierOfIfUnless: Description: >- Avoid modifier if/unless usage on conditionals. Enabled: true Style/IfWithSemicolon: Description: 'Do not use if x; .... Use the ternary operator instead.' StyleGuide: '#no-semicolon-ifs' Enabled: true Style/InfiniteLoop: Description: 'Use Kernel#loop for infinite loops.' StyleGuide: '#infinite-loop' Enabled: true Style/InverseMethods: Description: >- Use the inverse method instead of `!.method` if an inverse method is defined. Enabled: true Layout/IndentationWidth: Description: Use 2 spaces for indentation. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation Enabled: true Width: 2 Layout/IndentHash: Description: Checks the indentation of the first key in a hash literal. Enabled: true EnforcedStyle: consistent SupportedStyles: - consistent IndentationWidth: ~ Style/LambdaCall: Description: Use lambda.call(...) instead of lambda.(...). StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call Enabled: false EnforcedStyle: call SupportedStyles: - call - braces Style/Next: Description: Use `next` to skip iteration instead of a condition at the end. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals Enabled: false EnforcedStyle: skip_modifier_ifs MinBodyLength: 3 SupportedStyles: - skip_modifier_ifs - always Style/NonNilCheck: Description: Checks for redundant nil checks. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks Enabled: true IncludeSemanticChanges: false Style/MethodDefParentheses: Description: Checks if the method definitions have or don't have parentheses. StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens Enabled: true EnforcedStyle: require_parentheses SupportedStyles: - require_parentheses - require_no_parentheses Naming/MethodName: Description: Use the configured style when naming methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars Enabled: true EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase Layout/MultilineOperationIndentation: Description: Checks indentation of binary operations that span more than one line. Enabled: true EnforcedStyle: aligned SupportedStyles: - aligned - indented Style/NumericLiterals: Description: Add underscores to large numeric literals to improve their readability. StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics Enabled: false MinDigits: 5 Style/ParenthesesAroundCondition: Description: Don't use parentheses around the condition of an if/unless/while. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-if Enabled: true AllowSafeAssignment: true Style/PercentLiteralDelimiters: Description: Use `%`-literal delimiters consistently StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces Enabled: false PreferredDelimiters: "%": "()" "%i": "()" "%q": "()" "%Q": "()" "%r": "{}" "%s": "()" "%w": "()" "%W": "()" "%x": "()" Style/PercentQLiterals: Description: Checks if uses of %Q/%q match the configured preference. Enabled: true EnforcedStyle: lower_case_q SupportedStyles: - lower_case_q - upper_case_q Naming/PredicateName: Description: Check the names of predicate methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark Enabled: true NamePrefix: - is_ - has_ - have_ NamePrefixBlacklist: - is_ Exclude: - spec/**/* Style/RaiseArgs: Description: Checks the arguments passed to raise/fail. StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages Enabled: false EnforcedStyle: exploded SupportedStyles: - compact - exploded Style/RedundantReturn: Description: Don't use return where it's not required. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return Enabled: true AllowMultipleReturnValues: false Style/RegexpLiteral: Description: Use %r for regular expressions matching more than `MaxSlashes` '/' characters. Use %r only for regular expressions matching more than `MaxSlashes` '/' character. StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r Enabled: false Style/Semicolon: Description: Don't use semicolons to terminate expressions. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon Enabled: true AllowAsExpressionSeparator: false Style/SignalException: Description: Checks for proper usage of fail and raise. StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method Enabled: false EnforcedStyle: semantic SupportedStyles: - only_raise - only_fail - semantic Style/SingleLineBlockParams: Description: Enforces the names of some block params. StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks Enabled: false Methods: - reduce: - a - e - inject: - a - e Style/SingleLineMethods: Description: Avoid single-line methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods Enabled: false AllowIfMethodIsEmpty: true Style/StringLiterals: Description: Checks if uses of quotes match the configured preference. StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals Enabled: true EnforcedStyle: double_quotes SupportedStyles: - single_quotes - double_quotes Style/StringLiteralsInInterpolation: Description: Checks if uses of quotes inside expressions in interpolated strings match the configured preference. Enabled: false EnforcedStyle: single_quotes SupportedStyles: - single_quotes - double_quotes Layout/SpaceAroundBlockParameters: Description: Checks the spacing inside and after block parameters pipes. Enabled: false EnforcedStyleInsidePipes: no_space Layout/SpaceAroundEqualsInParameterDefault: Description: Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals Enabled: true EnforcedStyle: space SupportedStyles: - space - no_space Layout/SpaceBeforeBlockBraces: Description: Checks that the left block brace has or doesn't have space before it. Enabled: true EnforcedStyle: space SupportedStyles: - space - no_space Layout/SpaceInsideBlockBraces: Description: Checks that block braces have or don't have surrounding space. For blocks taking parameters, checks that the left brace has or doesn't have trailing space. Enabled: false EnforcedStyle: space SupportedStyles: - space - no_space EnforcedStyleForEmptyBraces: no_space SpaceBeforeBlockParameters: true Layout/SpaceInsideHashLiteralBraces: Description: Use spaces inside hash literal braces - or don't. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators Enabled: false EnforcedStyle: space EnforcedStyleForEmptyBraces: no_space SupportedStyles: - space - no_space Style/SymbolProc: Description: Use symbols as procs instead of blocks when possible. Enabled: true IgnoredMethods: - respond_to Layout/TrailingBlankLines: Description: Checks trailing blank lines and final newline. StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof Enabled: true EnforcedStyle: final_newline SupportedStyles: - final_newline - final_blank_line Style/TrivialAccessors: Description: Prefer attr_* methods to trivial readers/writers. StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family Enabled: false ExactNameMatch: false AllowPredicates: false AllowDSLWriters: false Whitelist: - to_ary - to_a - to_c - to_enum - to_h - to_hash - to_i - to_int - to_io - to_open - to_path - to_proc - to_r - to_regexp - to_str - to_s - to_sym Naming/VariableName: Description: Use the configured style when naming variables. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars Enabled: true EnforcedStyle: snake_case SupportedStyles: - snake_case - camelCase Style/WhileUntilModifier: Description: Favor modifier while/until usage when you have a single-line body. StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier Enabled: false Style/WordArray: Description: Use %w or %W for arrays of words. StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w Enabled: false MinSize: 0 WordRegex: !ruby/regexp /\A[\p{Word}]+\z/ Metrics/BlockLength: Enabled: true Exclude: - '**/spec/**/*' - '**/script/**/*' Metrics/AbcSize: Description: A calculated magnitude based on number of assignments, branches, and conditions. Enabled: true Max: 27 Exclude: - "db/data/*.rb" Metrics/BlockNesting: Description: Avoid excessive block nesting StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count Enabled: false Max: 3 Metrics/ClassLength: Description: Avoid classes longer than 100 lines of code. Enabled: false CountComments: false Max: 100 Metrics/CyclomaticComplexity: Description: A complexity metric that is strongly correlated to the number of test cases needed to validate a method. Enabled: false Max: 6 Metrics/LineLength: Description: Limit lines to 120 characters. StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits Enabled: true Max: 120 AllowURI: true URISchemes: - http - https Metrics/MethodLength: Description: Avoid methods longer than 10 lines of code. StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods Enabled: true CountComments: true Max: 20 Exclude: - "db/data/*.rb" Metrics/ParameterLists: Description: Avoid parameter lists longer than three or four parameters. StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params Enabled: false Max: 5 CountKeywordArgs: true Metrics/PerceivedComplexity: Description: A complexity metric geared towards measuring complexity for a human reader. Enabled: false Max: 7 Lint/AssignmentInCondition: Description: Don't use assignment in conditions. StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition Enabled: false AllowSafeAssignment: true Rails/ActionFilter: Description: Enforces consistent use of action filter methods. Enabled: false EnforcedStyle: action SupportedStyles: - action - filter Include: - app/controllers/**/*.rb Rails/HasAndBelongsToMany: Description: Prefer has_many :through to has_and_belongs_to_many. Enabled: true Include: - app/models/**/*.rb Rails/Output: Description: Checks for calls to puts, print, etc. Enabled: true Include: - app/**/*.rb - config/**/*.rb - db/**/*.rb - lib/**/*.rb Rails/ReadWriteAttribute: Description: Checks for read_attribute(:attr) and write_attribute(:attr, val). Enabled: true Include: - app/models/**/*.rb Rails/ScopeArgs: Description: Checks the arguments of ActiveRecord scopes. Enabled: true Include: - app/models/**/*.rb Rails/Validation: Description: Use validates :attribute, hash of validations. Enabled: true Include: - app/models/**/*.rb Style/InlineComment: Description: Avoid inline comments. Enabled: false Style/MethodCalledOnDoEndBlock: Description: Avoid chaining a method call on a do...end block. StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks Enabled: false Style/SymbolArray: Description: Use %i or %I for arrays of symbols. StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i Enabled: false Layout/ExtraSpacing: Description: Do not use unnecessary spacing. Enabled: false Naming/AccessorMethodName: Description: Check the naming of accessor methods for get_/set_. Enabled: false Style/Alias: Description: Use alias_method instead of alias. StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method Enabled: false Layout/AlignArray: Description: Align the elements of an array literal if they span more than one line. StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays Enabled: true Style/ArrayJoin: Description: Use Array#join instead of Array#*. StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join Enabled: false Style/AsciiComments: Description: Use only ascii symbols in comments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments Enabled: false Naming/AsciiIdentifiers: Description: Use only ascii symbols in identifiers. StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers Enabled: false Style/Attr: Description: Checks for uses of Module#attr. StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr Enabled: false Style/BeginBlock: Description: Avoid the use of BEGIN blocks. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks Enabled: true Style/BlockComments: Description: Do not use block comments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments Enabled: true Layout/BlockEndNewline: Description: Put end statement of multiline block on its own line. Enabled: true Style/BlockDelimiters: Enabled: false Style/CaseEquality: Description: Avoid explicit use of the case equality operator(===). StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality Enabled: false Style/CharacterLiteral: Description: Checks for uses of character literals. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals Enabled: false Naming/ClassAndModuleCamelCase: Description: Use CamelCase for classes and modules. StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes Enabled: true Style/ClassMethods: Description: Use self when defining module/class methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-singletons Enabled: true Style/ClassVars: Description: Avoid the use of class variables. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars Enabled: false Style/ColonMethodCall: Description: 'Do not use :: for method call.' StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons Enabled: false Layout/CommentIndentation: Description: Indentation of comments. Enabled: true Naming/ConstantName: Description: Constants should use SCREAMING_SNAKE_CASE. StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case Enabled: true Style/DefWithParentheses: Description: Use def with parentheses when there are arguments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens Enabled: true Style/PreferredHashMethods: Description: Checks for use of deprecated Hash methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key Enabled: false Style/Documentation: Description: Document classes and non-namespace modules. Enabled: false Style/DoubleNegation: Description: Checks for uses of double negation (!!). StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang Enabled: false Style/EachWithObject: Description: Prefer `each_with_object` over `inject` or `reduce`. Enabled: false Layout/ElseAlignment: Description: Align elses and elsifs correctly. Enabled: true Style/EmptyElse: Description: Avoid empty else-clauses. Enabled: true Layout/EmptyLines: Description: Don't use several empty lines in a row. Enabled: false Layout/EmptyLinesAroundAccessModifier: Description: Keep blank lines around access modifiers. Enabled: true Layout/EmptyLinesAroundMethodBody: Description: Keeps track of empty lines around method bodies. Enabled: true Style/EmptyLiteral: Description: Prefer literals to Array.new/Hash.new/String.new. StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash Enabled: false Style/EndBlock: Description: Avoid the use of END blocks. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks Enabled: true Layout/EndOfLine: Description: Use Unix-style line endings. StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf Enabled: true EnforcedStyle: lf Style/EvenOdd: Description: Favor the use of Fixnum#even? && Fixnum#odd? StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods Enabled: false Style/FlipFlop: Description: Checks for flip flops StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops Enabled: false Style/IfWithSemicolon: Description: Do not use if x; .... Use the ternary operator instead. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs Enabled: false Layout/IndentationConsistency: Description: Keep indentation straight. Enabled: true Layout/IndentArray: Description: Checks the indentation of the first element in an array literal. Enabled: true Style/InfiniteLoop: Description: Use Kernel#loop for infinite loops. StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop Enabled: true Style/Lambda: Description: Use the new lambda literal syntax for single-line blocks. StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line Enabled: false Layout/LeadingCommentSpace: Description: Comments should start with a space. StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space Enabled: false Style/LineEndConcatenation: Description: Use \ instead of + or << to concatenate two string literals at line end. Enabled: false Style/MethodCallWithoutArgsParentheses: Description: Do not use parentheses for method calls with no arguments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-args-no-parens Enabled: true Style/ModuleFunction: Description: Checks for usage of `extend self` in modules. StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function Enabled: false Style/MultilineBlockChain: Description: Avoid multi-line chains of blocks. StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks Enabled: false Layout/MultilineBlockLayout: Description: Ensures newlines after multiline block do statements. Enabled: true Style/MultilineIfThen: Description: Do not use then for multi-line if/unless. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then Enabled: true Style/MultilineTernaryOperator: Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.' StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary Enabled: false Style/NegatedIf: Description: Favor unless over if for negative conditions (or control flow or). StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives Enabled: false Style/NegatedWhile: Description: Favor until over while for negative conditions. StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives Enabled: false Style/NestedTernaryOperator: Description: Use one expression per branch in a ternary operator. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary Enabled: true Style/NilComparison: Description: Prefer x.nil? to x == nil. StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods Enabled: false Style/Not: Description: Use ! instead of not. StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not Enabled: false Style/OneLineConditional: Description: Favor the ternary operator(?:) over if/then/else/end constructs. StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator Enabled: false Style/PerlBackrefs: Description: Avoid Perl-style regex back references. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers Enabled: false Style/Proc: Description: Use proc instead of Proc.new. StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc Enabled: false Style/RedundantBegin: Description: Don't use begin blocks when they are not needed. StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit Enabled: true Style/RedundantException: Description: Checks for an obsolete RuntimeException argument in raise/fail. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror Enabled: true Style/RedundantSelf: Description: Don't use self where it's not needed. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required Enabled: false Style/RescueModifier: Description: Avoid using rescue in its modifier form. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers Enabled: true Style/SelfAssignment: Description: Checks for places where self-assignment shorthand should have been used. StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment Enabled: false Layout/SpaceAfterColon: Description: Use spaces after colons. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators Enabled: true Layout/SpaceAfterComma: Description: Use spaces after commas. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators Enabled: true Layout/SpaceAfterMethodName: Description: Do not put a space between a method name and the opening parenthesis in a method definition. StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces Enabled: true Layout/SpaceAfterNot: Description: Tracks redundant space after the ! operator. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang Enabled: true Layout/SpaceAfterSemicolon: Description: Use spaces after semicolons. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators Enabled: true Layout/SpaceBeforeComma: Description: No spaces before commas. Enabled: true Layout/SpaceBeforeComment: Description: Checks for missing space between code and a comment on the same line. Enabled: false Layout/SpaceBeforeSemicolon: Description: No spaces before semicolons. Enabled: true Layout/SpaceAroundOperators: Description: Use spaces around operators. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators Enabled: false Layout/SpaceInsideParens: Description: No spaces after ( or before ). StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces Enabled: false Layout/SpaceInsideRangeLiteral: Description: No spaces inside range literals. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals Enabled: true Style/SpecialGlobalVars: Description: Avoid Perl-style global variables. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms Enabled: false Style/StructInheritance: Description: Checks for inheritance from Struct.new. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new Enabled: true Layout/Tab: Description: No hard tabs. StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation Enabled: true Layout/TrailingWhitespace: Description: Avoid trailing whitespace. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace Enabled: true Style/UnlessElse: Description: Do not use unless with else. Rewrite these with the positive case first. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless Enabled: true Style/UnneededCapitalW: Description: Checks for %W when interpolation is not needed. Enabled: true Style/UnneededPercentQ: Description: Checks for %q/%Q when single quotes or double quotes would do. StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q Enabled: true Style/VariableInterpolation: Description: Don't interpolate global, instance and class variables directly in strings. StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate Enabled: false Style/WhenThen: Description: Use when x then ... for one-line cases. StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases Enabled: false Style/WhileUntilDo: Description: Checks for redundant do after while or until. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do Enabled: true Lint/AmbiguousOperator: Description: Checks for ambiguous operators in the first argument of a method invocation without parentheses. StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args Enabled: false Lint/AmbiguousRegexpLiteral: Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parenthesis. Enabled: false Lint/BlockAlignment: Description: Align block ends correctly. Enabled: true Lint/ConditionPosition: Description: Checks for condition placed in a confusing position relative to the keyword. StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition Enabled: false Lint/Debugger: Description: Check for debugger calls. Enabled: false Lint/DeprecatedClassMethods: Description: Check for deprecated class method calls. Enabled: false Lint/DuplicateMethods: Description: Check for duplicate methods calls. Enabled: true Lint/ElseLayout: Description: Check for odd code arrangement in an else block. Enabled: false Lint/EmptyEnsure: Description: Checks for empty ensure block. Enabled: true Lint/EmptyInterpolation: Description: Checks for empty string interpolation. Enabled: true Lint/EndInMethod: Description: END blocks should not be placed inside method definitions. Enabled: true Lint/EnsureReturn: Description: Do not use return in an ensure block. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure Enabled: true Security/Eval: Description: The use of eval represents a serious security risk. Enabled: true Lint/HandleExceptions: Description: Don't suppress exception. StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions Enabled: false Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. Enabled: false Lint/Loop: Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests. StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break Enabled: false Lint/ParenthesesAsGroupedExpression: Description: Checks for method calls with a space before the opening parenthesis. StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces Enabled: false Lint/RequireParentheses: Description: Use parentheses in the method call to avoid confusion about precedence. Enabled: false Lint/RescueException: Description: Avoid rescuing the Exception class. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues Enabled: true Lint/ShadowingOuterLocalVariable: Description: Do not use the same name as outer local variable for block arguments or block local variables. Enabled: true Layout/SpaceBeforeFirstArg: Description: Put a space between a method name and the first argument in a method call without parentheses. Enabled: true Lint/StringConversionInInterpolation: Description: Checks for Object#to_s usage in string interpolation. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s Enabled: true Lint/UnderscorePrefixedVariableName: Description: Do not use prefix `_` for a variable that is used. Enabled: false Lint/UnusedBlockArgument: Description: Checks for unused block arguments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars Enabled: true Lint/UnusedMethodArgument: Description: Checks for unused method arguments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars Enabled: true Lint/UnreachableCode: Description: Unreachable code. Enabled: true Lint/UselessAccessModifier: Description: Checks for useless access modifiers. Enabled: true Lint/UselessAssignment: Description: Checks for useless assignment to a local variable. StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars Enabled: true Lint/UselessComparison: Description: Checks for comparison of something with itself. Enabled: true Lint/UselessElseWithoutRescue: Description: Checks for useless `else` in `begin..end` without `rescue`. Enabled: true Lint/UselessSetterCall: Description: Checks for useless setter call to a local variable. Enabled: true Lint/Void: Description: Possible use of operator/literal/variable in void context. Enabled: false Rails/Delegate: Description: Prefer delegate method for delegations. Enabled: false Style/FrozenStringLiteralComment: Description: >- Add the frozen_string_literal comment to the top of files to help transition from Ruby 2.3.0 to Ruby 3.0. Enabled: false Layout/SpaceBeforeFirstArg: Enabled: false Style/FormatStringToken: Enabled: falseruby-data-migrate-5.3.1/tasks/0000755000175000017500000000000013417546235014573 5ustar aleealeeruby-data-migrate-5.3.1/tasks/databases.rake0000644000175000017500000003461113417546235017373 0ustar aleealeerequire 'data_migrate/tasks/data_migrate_tasks' namespace :db do namespace :migrate do desc "Migrate the database data and schema (options: VERSION=x, VERBOSE=false)." task :with_data => :environment do assure_data_schema_table ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true target_version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil migrations = [] if target_version.nil? migrations = pending_migrations.map{ |m| m.merge(:direction =>:up) } else current_schema_version = ActiveRecord::Migrator.current_version schema_migrations = if target_version > current_schema_version pending_schema_migrations.keep_if{ |m| m[:version] <= target_version }.map{ |m| m.merge(:direction =>:up) } elsif target_version < current_schema_version past_migrations.keep_if{ |m| m[:version] > target_version }.map{ |m| m.merge(:direction =>:down) } else # == [] end current_data_version = ActiveRecord::Migrator.current_version data_migrations = if target_version > current_data_version pending_data_migrations.keep_if{ |m| m[:version] <= target_version }.map{ |m| m.merge(:direction =>:up) } elsif target_version < current_data_version past_migrations.keep_if{ |m| m[:version] > target_version }.map{ |m| m.merge(:direction =>:down) } else # == [] end migrations = if schema_migrations.empty? data_migrations elsif data_migrations.empty? schema_migrations elsif target_version > current_data_version && target_version > current_schema_version sort_migrations data_migrations, schema_migrations elsif target_version < current_data_version && target_version < current_schema_version sort_migrations(data_migrations, schema_migrations).reverse elsif target_version > current_data_version && target_version < current_schema_version schema_migrations + data_migrations elsif target_version < current_data_version && target_version > current_schema_version schema_migrations + data_migrations end end migrations.each do |migration| if migration[:kind] == :data ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71]) DataMigrate::DataMigrator.run(migration[:direction], data_migrations_path, migration[:version]) else ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69]) DataMigrate::SchemaMigration.run( migration[:direction], Rails.application.config.paths["db/migrate"], migration[:version] ) end end Rake::Task["db:_dump"].invoke Rake::Task["data:dump"].invoke end namespace :redo do desc 'Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x).' task :with_data => :environment do assure_data_schema_table if ENV["VERSION"] Rake::Task["db:migrate:down:with_data"].invoke Rake::Task["db:migrate:up:with_data"].invoke else Rake::Task["db:rollback:with_data"].invoke Rake::Task["db:migrate:with_data"].invoke end end end namespace :up do desc 'Runs the "up" for a given migration VERSION. (options both=false)' task :with_data => :environment do version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil raise "VERSION is required" unless version assure_data_schema_table run_both = ENV["BOTH"] == "true" migrations = pending_migrations.keep_if{|m| m[:version] == version} unless run_both || migrations.size < 2 migrations = migrations.slice(0,1) end migrations.each do |migration| if migration[:kind] == :data ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71]) DataMigrate::DataMigrator.run(:up, data_migrations_path, migration[:version]) else ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69]) DataMigrate::SchemaMigration.run(:up, "db/migrate/", migration[:version]) end end Rake::Task["db:_dump"].invoke Rake::Task["data:dump"].invoke end end namespace :down do desc 'Runs the "down" for a given migration VERSION. (option BOTH=false)' task :with_data => :environment do version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil raise "VERSION is required" unless version assure_data_schema_table run_both = ENV["BOTH"] == "true" migrations = past_migrations.keep_if{|m| m[:version] == version} unless run_both || migrations.size < 2 migrations = migrations.slice(0,1) end migrations.each do |migration| if migration[:kind] == :data ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71]) DataMigrate::DataMigrator.run(:down, data_migrations_path, migration[:version]) else ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69]) DataMigrate::SchemaMigration.run(:down, "db/migrate/", migration[:version]) end end Rake::Task["db:_dump"].invoke Rake::Task["data:dump"].invoke end end namespace :status do desc "Display status of data and schema migrations" task :with_data => :environment do config = connect_to_database next unless config db_list_data = ActiveRecord::Base.connection.select_values( "SELECT version FROM #{DataMigrate::DataSchemaMigration.table_name}" ) db_list_schema = ActiveRecord::Base.connection.select_values( "SELECT version FROM #{ActiveRecord::SchemaMigration.schema_migrations_table_name}" ) file_list = [] Dir.foreach(File.join(Rails.root, data_migrations_path)) do |file| # only files matching "20091231235959_some_name.rb" pattern if match_data = /(\d{14})_(.+)\.rb/.match(file) status = db_list_data.delete(match_data[1]) ? 'up' : 'down' file_list << [status, match_data[1], match_data[2], 'data'] end end Dir.foreach(File.join(Rails.root, 'db', 'migrate')) do |file| # only files matching "20091231235959_some_name.rb" pattern if match_data = /(\d{14})_(.+)\.rb/.match(file) status = db_list_schema.delete(match_data[1]) ? 'up' : 'down' file_list << [status, match_data[1], match_data[2], 'schema'] end end file_list.sort!{|a,b| "#{a[1]}_#{a[3] == 'data' ? 1 : 0}" <=> "#{b[1]}_#{b[3] == 'data' ? 1 : 0}" } # output puts "\ndatabase: #{config['database']}\n\n" puts "#{"Status".center(8)} #{"Type".center(8)} #{"Migration ID".ljust(14)} Migration Name" puts "-" * 60 file_list.each do |file| puts "#{file[0].center(8)} #{file[3].center(8)} #{file[1].ljust(14)} #{file[2].humanize}" end db_list_schema.each do |version| puts "#{'up'.center(8)} #{version.ljust(14)} *** NO SCHEMA FILE ***" end db_list_data.each do |version| puts "#{'up'.center(8)} #{version.ljust(14)} *** NO DATA FILE ***" end puts end end end # END OF MIGRATE NAME SPACE namespace :rollback do desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).' task :with_data => :environment do step = ENV['STEP'] ? ENV['STEP'].to_i : 1 assure_data_schema_table past_migrations[0..(step - 1)].each do | past_migration | if past_migration[:kind] == :data ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71]) DataMigrate::DataMigrator.run(:down, data_migrations_path, past_migration[:version]) elsif past_migration[:kind] == :schema ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69]) ActiveRecord::Migrator.run(:down, "db/migrate/", past_migration[:version]) end end Rake::Task["db:_dump"].invoke Rake::Task["data:dump"].invoke end end namespace :forward do desc 'Pushes the schema to the next version (specify steps w/ STEP=n).' task :with_data => :environment do assure_data_schema_table step = ENV['STEP'] ? ENV['STEP'].to_i : 1 DataMigrate::DatabaseTasks.forward(step) Rake::Task["db:_dump"].invoke Rake::Task["data:dump"].invoke end end namespace :version do desc "Retrieves the current schema version numbers for data and schema migrations" task :with_data => :environment do assure_data_schema_table puts "Current Schema version: #{ActiveRecord::Migrator.current_version}" puts "Current Data version: #{DataMigrate::DataMigrator.current_version}" end end namespace :schema do namespace :load do desc "Load both schema.rb and data_schema.rb file into the database" task with_data: :environment do Rake::Task["db:schema:load"].invoke DataMigrate::DatabaseTasks.load_schema_current( :ruby, ENV["DATA_SCHEMA"] ) end end end namespace :structure do namespace :load do desc "Load both structure.sql and data_schema.rb file into the database" task with_data: :environment do Rake::Task["db:structure:load"].invoke DataMigrate::DatabaseTasks.load_schema_current( :ruby, ENV["DATA_SCHEMA"] ) end end end end namespace :data do desc 'Migrate data migrations (options: VERSION=x, VERBOSE=false)' task :migrate => :environment do DataMigrate::Tasks::DataMigrateTasks.migrate Rake::Task["data:dump"].invoke end namespace :migrate do desc 'Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x).' task :redo => :environment do assure_data_schema_table if ENV["VERSION"] Rake::Task["data:migrate:down"].invoke Rake::Task["data:migrate:up"].invoke else Rake::Task["data:rollback"].invoke Rake::Task["data:migrate"].invoke end end desc 'Runs the "up" for a given migration VERSION.' task :up => :environment do assure_data_schema_table version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil raise "VERSION is required" unless version DataMigrate::DataMigrator.run(:up, data_migrations_path, version) Rake::Task["data:dump"].invoke end desc 'Runs the "down" for a given migration VERSION.' task :down => :environment do version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil raise "VERSION is required" unless version assure_data_schema_table DataMigrate::DataMigrator.run(:down, data_migrations_path, version) Rake::Task["data:dump"].invoke end desc "Display status of data migrations" task :status => :environment do config = ActiveRecord::Base.configurations[Rails.env || 'development'] ActiveRecord::Base.establish_connection(config) connection = ActiveRecord::Base.connection puts "\ndatabase: #{config['database']}\n\n" DataMigrate::StatusService.dump(connection) end end desc 'Rolls the schema back to the previous version (specify steps w/ STEP=n).' task :rollback => :environment do assure_data_schema_table step = ENV['STEP'] ? ENV['STEP'].to_i : 1 DataMigrate::DataMigrator.rollback(data_migrations_path, step) Rake::Task["data:dump"].invoke end desc 'Pushes the schema to the next version (specify steps w/ STEP=n).' task :forward => :environment do assure_data_schema_table step = ENV['STEP'] ? ENV['STEP'].to_i : 1 # TODO: No worky for .forward # DataMigrate::DataMigrator.forward('db/data/', step) migrations = pending_data_migrations.reverse.pop(step).reverse migrations.each do | pending_migration | DataMigrate::DataMigrator.run(:up, data_migrations_path, pending_migration[:version]) end Rake::Task["data:dump"].invoke end desc "Retrieves the current schema version number for data migrations" task :version => :environment do assure_data_schema_table puts "Current data version: #{DataMigrate::DataMigrator.current_version}" end desc "Create a db/data_schema.rb file that stores the current data version" task dump: :environment do if ActiveRecord::Base.dump_schema_after_migration filename = DataMigrate::DatabaseTasks.schema_file File.open(filename, "w:utf-8") do |file| DataMigrate::SchemaDumper.dump(ActiveRecord::Base.connection, file) end end # Allow this task to be called as many times as required. An example # is the migrate:redo task, which calls other two internally # that depend on this one. Rake::Task["data:dump"].reenable end end def pending_migrations DataMigrate::DatabaseTasks.sort_migrations( DataMigrate::DatabaseTasks.pending_schema_migrations, DataMigrate::DatabaseTasks.pending_data_migrations ) end def pending_data_migrations DataMigrate::DatabaseTasks.pending_data_migrations end def pending_schema_migrations DataMigrate::DatabaseTasks.pending_schema_migrations end def sort_migrations set_1, set_2=nil migrations = set_1 + (set_2 || []) migrations.sort{|a,b| sort_string(a) <=> sort_string(b)} end def sort_string migration "#{migration[:version]}_#{migration[:kind] == :data ? 1 : 0}" end def connect_to_database config = ActiveRecord::Base.configurations[Rails.env || 'development'] ActiveRecord::Base.establish_connection(config) unless DataMigrate::DataSchemaMigration.table_exists? puts 'Data migrations table does not exist yet.' config = nil end unless ActiveRecord::SchemaMigration.table_exists? puts 'Schema migrations table does not exist yet.' config = nil end config end def past_migrations(sort=nil) DataMigrate::DatabaseTasks.past_migrations(sort) end def assure_data_schema_table DataMigrate::DataMigrator.assure_data_schema_table end def data_migrations_path DataMigrate.config.data_migrations_path end ruby-data-migrate-5.3.1/tasks/.gitkeep0000644000175000017500000000000013374461640016210 0ustar aleealeeruby-data-migrate-5.3.1/lib/0000755000175000017500000000000013417546235014214 5ustar aleealeeruby-data-migrate-5.3.1/lib/data_migrate.rb0000644000175000017500000000313113417546235017160 0ustar aleealee# frozen_string_literal: true if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR == 2 require File.join(File.dirname(__FILE__), "data_migrate", "data_migrator_five") else require File.join(File.dirname(__FILE__), "data_migrate", "data_migrator") end require File.join(File.dirname(__FILE__), "data_migrate", "data_schema_migration") require File.join(File.dirname(__FILE__), "data_migrate", "data_schema") require File.join(File.dirname(__FILE__), "data_migrate", "database_tasks") require File.join(File.dirname(__FILE__), "data_migrate", "schema_dumper") if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR == 2 require File.join(File.dirname(__FILE__), "data_migrate", "status_service_five") require File.join(File.dirname(__FILE__), "data_migrate", "schema_migration_five") else require File.join(File.dirname(__FILE__), "data_migrate", "status_service") require File.join(File.dirname(__FILE__), "data_migrate", "schema_migration") end if Rails::VERSION::MAJOR == 5 if Rails::VERSION::MINOR == 2 require File.join(File.dirname(__FILE__), "data_migrate", "migration_context") else require File.join(File.dirname(__FILE__), "data_migrate", "migration_five") end else require File.join(File.dirname(__FILE__), "data_migrate", "migration") end require File.join(File.dirname(__FILE__), "data_migrate", "railtie") require File.join(File.dirname(__FILE__), "data_migrate", "tasks/data_migrate_tasks") require File.join(File.dirname(__FILE__), "data_migrate", "legacy_migrator") require File.join(File.dirname(__FILE__), "data_migrate", "config") module DataMigrate end ruby-data-migrate-5.3.1/lib/generators/0000755000175000017500000000000013374461640016363 5ustar aleealeeruby-data-migrate-5.3.1/lib/generators/data_migrate.rb0000644000175000017500000000050613374461640021332 0ustar aleealeerequire 'rails/generators/named_base' module DataMigrate module Generators class DataMigrationGenerator < Rails::Generators::NamedBase #:nodoc: def self.source_root @_data_migrate_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), generator_name, 'templates')) end end end end ruby-data-migrate-5.3.1/lib/generators/data_migration/0000755000175000017500000000000013417546235021347 5ustar aleealeeruby-data-migrate-5.3.1/lib/generators/data_migration/data_migration_generator.rb0000644000175000017500000000237513417546235026733 0ustar aleealeerequire "generators/data_migrate" require "rails/generators" require "rails/generators/active_record/migration" require "rails/generators/migration" require "data_migrate/config" module DataMigrate module Generators class DataMigrationGenerator < Rails::Generators::NamedBase namespace "data_migration" include ActiveRecord::Generators::Migration argument :attributes, type: :array, default: [], banner: "field:type field:type" def create_data_migration set_local_assigns! migration_template "data_migration.rb", "#{data_migrations_path}#{file_name}.rb" end protected def set_local_assigns! if file_name =~ /^(add|remove)_.*_(?:to|from)_(.*)/ @migration_action = $1 @table_name = $2.pluralize end end def migration_base_class_name if ActiveRecord.version >= Gem::Version.new("5.0") "ActiveRecord::Migration[#{ActiveRecord::Migration.current_version}]" elsif ActiveRecord.version >= Gem::Version.new("5.2") "DataMigrate::MigrationContext" else "ActiveRecord::Migration" end end def data_migrations_path DataMigrate.config.data_migrations_path end end end end ruby-data-migrate-5.3.1/lib/generators/data_migration/templates/0000755000175000017500000000000013417546235023345 5ustar aleealeeruby-data-migrate-5.3.1/lib/generators/data_migration/templates/migration.rb0000644000175000017500000000116013374461640025657 0ustar aleealeeclass <%= migration_class_name %> < ActiveRecord::Migration def self.up <% attributes.each do |attribute| -%> <%- if migration_action -%> <%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end %> <%- end -%> <%- end -%> end def self.down <% attributes.reverse.each do |attribute| -%> <%- if migration_action -%> <%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><% end %> <%- end -%> <%- end -%> end end ruby-data-migrate-5.3.1/lib/generators/data_migration/templates/data_migration.rb0000644000175000017500000000023013417546235026647 0ustar aleealeeclass <%= migration_class_name %> < <%= migration_base_class_name %> def up end def down raise ActiveRecord::IrreversibleMigration end end ruby-data-migrate-5.3.1/lib/capistrano/0000755000175000017500000000000013374461640016355 5ustar aleealeeruby-data-migrate-5.3.1/lib/capistrano/data_migrate.rb0000644000175000017500000000014113374461640021317 0ustar aleealeerequire 'capistrano' require File.expand_path("#{File.dirname(__FILE__)}/data_migrate/migrate") ruby-data-migrate-5.3.1/lib/capistrano/data_migrate/0000755000175000017500000000000013374461640020776 5ustar aleealeeruby-data-migrate-5.3.1/lib/capistrano/data_migrate/migrate.rb0000644000175000017500000000253013374461640022753 0ustar aleealeenamespace :deploy do desc 'Runs rake data:migrate if migrations are set' Rake::Task['deploy:migrate'].clear_actions task :migrate => [:set_rails_env] do on fetch(:migration_servers) do conditionally_migrate = fetch(:conditionally_migrate) info '[deploy:migrate] Checking changes in db/migrate or db/data' if conditionally_migrate if conditionally_migrate && ( test("diff -q #{release_path}/db/migrate #{current_path}/db/migrate") || test("diff -q #{release_path}/db/data #{current_path}/db/data") ) info '[deploy:migrate] Skip `deploy:migrate` (nothing changed in db/migrate or db/data)' else info '[deploy:migrate] Run `rake db:migrate:with_data`' invoke :'deploy:migrating_with_data' end end end desc 'Runs rake db:migrate:with_data' task migrating_with_data: [:set_rails_env] do on fetch(:migration_servers) do within release_path do with rails_env: fetch(:rails_env) do execute :rake, 'db:migrate:with_data' end end end end after 'deploy:updated', 'deploy:migrate' end namespace :load do task :defaults do set :conditionally_migrate, fetch(:conditionally_migrate, false) set :migration_role, fetch(:migration_role, :db) set :migration_servers, -> { primary(fetch(:migration_role)) } end end ruby-data-migrate-5.3.1/lib/data_migrate/0000755000175000017500000000000013417546235016635 5ustar aleealeeruby-data-migrate-5.3.1/lib/data_migrate/schema_dumper.rb0000644000175000017500000000200313417546235021771 0ustar aleealee# frozen_string_literal: true module DataMigrate ## # Provides the capability to write the current data schema version to # the data_schema file Based on ActiveRecord::SchemaDumper class SchemaDumper private_class_method :new class << self def dump(connection = ActiveRecord::Base.connection, stream = STDOUT) new(connection).dump(stream) stream end end def dump(stream) define_params = @version ? "version: #{@version}" : "" if stream.respond_to?(:external_encoding) && stream.external_encoding stream.puts "# encoding: #{stream.external_encoding.name}" end stream.puts "DataMigrate::Data.define(#{define_params})" stream end private def initialize(connection) @connection = connection all_versions = DataSchemaMigration.normalized_versions @version = begin all_versions.max rescue StandardError 0 end end end end ruby-data-migrate-5.3.1/lib/data_migrate/data_schema.rb0000644000175000017500000000312613417546235021415 0ustar aleealee# frozen_string_literal: true module DataMigrate ## # Provides the definition method for data_schema.rb class Data < ActiveRecord::Schema # This method is based on the following two methods # ActiveRecord::Schema#define # ActiveRecord::ConnectionAdapters::SchemaStatements # #assume_migrated_upto_version def define(info) DataMigrate::DataMigrator.assure_data_schema_table return if info[:version].blank? version = info[:version].to_i unless migrated.include?(version) execute "INSERT INTO #{sm_table} (version) VALUES ('#{version}')" end insert(version) end private def migrated @migrated ||= select_values("SELECT version FROM #{sm_table}").map(&:to_i) end def versions @versions ||= begin versions = [] Dir.foreach(DataMigrate::DataMigrator.full_migrations_path) do |file| match_data = DataMigrate::DataMigrator.match(file) versions << match_data[1].to_i if match_data end versions end end def insert(version) inserted = Set.new (versions - migrated).each do |v| if inserted.include?(v) raise "Duplicate data migration #{v}. Please renumber your data " \ "migrations to resolve the conflict." elsif v < version execute "INSERT INTO #{sm_table} (version) VALUES ('#{v}')" inserted << v end end end def sm_table quote_table_name(table_name) end def table_name DataMigrate::DataSchemaMigration.table_name end end end ruby-data-migrate-5.3.1/lib/data_migrate/migration_five.rb0000644000175000017500000000127613374461640022170 0ustar aleealeemodule DataMigrate class MigrationFive < ::ActiveRecord::Migration[5.0] class << self def check_pending!(connection = ::ActiveRecord::Base.connection) raise ActiveRecord::PendingMigrationError if DataMigrator::Migrator.needs_migration?(connection) end def migrate(direction) new.migrate direction end def table_name ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix end def index_name "#{table_name_prefix}unique_data_migrations#{table_name_suffix}" end end def initialize(name = self.class.name, version = nil) super(name, version) end end end ruby-data-migrate-5.3.1/lib/data_migrate/data_schema_migration.rb0000644000175000017500000000054713417546235023472 0ustar aleealeemodule DataMigrate class DataSchemaMigration < ::ActiveRecord::SchemaMigration class << self def table_name ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix end def index_name "#{table_name_prefix}unique_data_migrations#{table_name_suffix}" end end end end ruby-data-migrate-5.3.1/lib/data_migrate/schema_migration_five.rb0000644000175000017500000000170313417546235023505 0ustar aleealeemodule DataMigrate # Helper class to getting access to db schema # to allow data/schema combiation tasks class SchemaMigration def self.pending_schema_migrations all_migrations = ActiveRecord::MigrationContext.new(migrations_paths).migrations sort_migrations( ActiveRecord::Migrator.new(:up, all_migrations). pending_migrations. map {|m| { version: m.version, kind: :schema }} ) end def self.run(direction, migration_paths, version) ActiveRecord::MigrationContext.new(migration_paths).run(direction, version) end def self.sort_migrations(set1, set2 = nil) migrations = set1 + (set2 || []) migrations.sort {|a, b| sort_string(a) <=> sort_string(b)} end def self.migrations_paths Rails.application.config.paths["db/migrate"].to_a end def self.sort_string(migration) "#{migration[:version]}_#{migration[:kind] == :data ? 1 : 0}" end end end ruby-data-migrate-5.3.1/lib/data_migrate/status_service.rb0000644000175000017500000000345413417546235022233 0ustar aleealeemodule DataMigrate class StatusService class << self def dump(connection = ActiveRecord::Base.connection, stream = STDOUT) new(connection).dump(stream) stream end end def initialize(connection) @connection = connection end def root_folder Rails.root end def dump(stream) unless @connection.table_exists?(table_name) stream.puts "Data migrations table does not exist yet." return end sql = "SELECT version FROM #{DataMigrate::DataMigrator.schema_migrations_table_name}" db_list = ActiveRecord::Base.connection.select_values(sql) output(stream, db_list) end private def table_name DataMigrate::DataMigrator.schema_migrations_table_name end def output(stream, db_list) stream.puts "#{"Status".center(8)} #{"Migration ID".ljust(14)} Migration Name" stream.puts "-" * 50 list = migration_files(db_list) + migration_list(db_list) list.sort! {|line1, line2| line1[1] <=> line2[1]} list.each do |file| stream.puts "#{file[0].center(8)} #{file[1].ljust(14)} #{file[2]}" end stream.puts end def migration_list(db_list) list = [] db_list.each do |version| list << ["up", version, "********** NO FILE *************"] end list end def migration_files(db_list) file_list = [] Dir.foreach(File.join(root_folder, DataMigrate.config.data_migrations_path)) do |file| # only files matching "20091231235959_some_name.rb" pattern if match_data = DataMigrate::DataMigrator.match(file) status = db_list.delete(match_data[1]) ? "up" : "down" file_list << [status, match_data[1], match_data[2].humanize] end end file_list end end end ruby-data-migrate-5.3.1/lib/data_migrate/migration.rb0000644000175000017500000000126513417546235021157 0ustar aleealeemodule DataMigrate class Migration < ::ActiveRecord::Migration class << self def check_pending!(connection = ::ActiveRecord::Base.connection) raise ActiveRecord::PendingMigrationError if DataMigrator::Migrator.needs_migration?(connection) end def migrate(direction) new.migrate direction end def table_name ActiveRecord::Base.table_name_prefix + "data_migrations" + ActiveRecord::Base.table_name_suffix end def index_name "#{table_name_prefix}unique_data_migrations#{table_name_suffix}" end end def initialize(name = self.class.name, version = nil) super(name, version) end end end ruby-data-migrate-5.3.1/lib/data_migrate/legacy_migrator.rb0000644000175000017500000000116013417546235022330 0ustar aleealeemodule DataMigrate class LegacyMigrator def initialize(migrations_paths = "db/data") @migrations_paths = migrations_paths || "db/data" end def migrate dates = DataMigrate::DataMigrator.migrations(@migrations_paths).collect(&:version) legacy = ActiveRecord::SchemaMigration.where(version: dates) legacy.each do |v| begin version = v.version puts "Creating #{version} in data schema" DataMigrate::DataSchemaMigration.create(version: version) rescue ActiveRecord::RecordNotUnique nil end end end end end ruby-data-migrate-5.3.1/lib/data_migrate/railtie.rb0000644000175000017500000000041513374461640020611 0ustar aleealeemodule DataMigrate class Railtie < ::Rails::Railtie generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators rake_tasks do load File.join(File.dirname(__FILE__), '..', '..', 'tasks/databases.rake') end end end ruby-data-migrate-5.3.1/lib/data_migrate/tasks/0000755000175000017500000000000013417546235017762 5ustar aleealeeruby-data-migrate-5.3.1/lib/data_migrate/tasks/data_migrate_tasks.rb0000644000175000017500000000120613417546235024134 0ustar aleealeemodule DataMigrate module Tasks module DataMigrateTasks extend self def migrations_paths @migrations_paths ||= DataMigrate.config.data_migrations_path end def migrate DataMigrate::DataMigrator.assure_data_schema_table target_version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR == 2 DataMigrate::MigrationContext.new(migrations_paths).migrate(target_version) else DataMigrate::DataMigrator.migrate(migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) end end end end end ruby-data-migrate-5.3.1/lib/data_migrate/database_tasks.rb0000644000175000017500000000522113417546235022133 0ustar aleealee# frozen_string_literal: true require "data_migrate/config" module DataMigrate ## # This class extends DatabaseTasks to add a schema_file method. class DatabaseTasks extend ActiveRecord::Tasks::DatabaseTasks # This overrides ActiveRecord::Tasks::DatabaseTasks def self.schema_file(_format = nil) File.join(db_dir, "data_schema.rb") end def self.forward(step = 1) DataMigrate::DataMigrator.assure_data_schema_table migrations = pending_migrations.reverse.pop(step).reverse migrations.each do | pending_migration | if pending_migration[:kind] == :data ActiveRecord::Migration.write("== %s %s" % ["Data", "=" * 71]) DataMigrate::DataMigrator.run(:up, data_migrations_path, pending_migration[:version]) elsif pending_migration[:kind] == :schema ActiveRecord::Migration.write("== %s %s" % ["Schema", "=" * 69]) DataMigrate::SchemaMigration.run(:up, schema_migrations_path, pending_migration[:version]) end end end def self.data_migrations_path DataMigrate.config.data_migrations_path end def self.schema_migrations_path "db/migrate/" end def self.pending_migrations sort_migrations(pending_schema_migrations, pending_data_migrations) end def self.pending_data_migrations data_migrations = DataMigrate::DataMigrator.migrations(data_migrations_path) sort_migrations(DataMigrate::DataMigrator.new(:up, data_migrations ). pending_migrations.map {|m| { version: m.version, kind: :data }}) end def self.pending_schema_migrations ::DataMigrate::SchemaMigration.pending_schema_migrations end def self.sort_migrations(set1, set2 = nil) migrations = set1 + (set2 || []) migrations.sort {|a, b| sort_string(a) <=> sort_string(b)} end def self.sort_string(migration) "#{migration[:version]}_#{migration[:kind] == :data ? 1 : 0}" end def self.past_migrations(sort = nil) sort = sort.downcase if sort db_list_data = if DataMigrate::DataSchemaMigration.table_exists? DataMigrate::DataSchemaMigration.normalized_versions.sort else [] end db_list_schema = ActiveRecord::SchemaMigration.normalized_versions.sort.sort migrations = db_list_data.map do |d| { version: d.to_i, kind: :data } end + db_list_schema.map do |d| { version: d.to_i, kind: :schema } end sort == "asc" ? sort_migrations(migrations) : sort_migrations(migrations).reverse end end end ruby-data-migrate-5.3.1/lib/data_migrate/status_service_five.rb0000644000175000017500000000210613417546235023235 0ustar aleealeemodule DataMigrate class StatusService class << self def dump(connection = ActiveRecord::Base.connection, stream = STDOUT) new(connection).dump(stream) stream end end def initialize(connection) @connection = connection end def root_folder Rails.root end def dump(stream) output(stream) end private def table_name DataMigrate::DataSchemaMigration.table_name end def output(stream) unless DataMigrate::DataSchemaMigration.table_exists? stream.puts "Data migrations table does not exist yet." return end # output stream.puts "\ndatabase: #{ActiveRecord::Base.connection_config[:database]}\n\n" stream.puts "#{'Status'.center(8)} #{'Migration ID'.ljust(14)} Migration Name" stream.puts "-" * 50 db_list.each do |status, version, name| stream.puts "#{status.center(8)} #{version.ljust(14)} #{name}" end stream.puts end def db_list DataMigrate::DataMigrator.migrations_status end end end ruby-data-migrate-5.3.1/lib/data_migrate/version.rb0000644000175000017500000000006213417546235020645 0ustar aleealeemodule DataMigrate VERSION = "5.3.1".freeze end ruby-data-migrate-5.3.1/lib/data_migrate/data_migrator.rb0000644000175000017500000000635113417546235022004 0ustar aleealee# frozen_string_literal: true require "active_record" module DataMigrate class DataMigrator < ActiveRecord::Migrator def record_version_state_after_migrating(version) if down? migrated.delete(version) DataMigrate::DataSchemaMigration.where(version: version.to_s).delete_all else migrated << version DataMigrate::DataSchemaMigration.create!(version: version.to_s) end end def load_migrated(connection = ActiveRecord::Base.connection) self.class.get_all_versions(connection) end class << self def current_version(connection = ActiveRecord::Base.connection) get_all_versions(connection).max || 0 end def get_all_versions(connection = ActiveRecord::Base.connection) if table_exists?(connection, schema_migrations_table_name) DataMigrate::DataSchemaMigration.all.map { |x| x.version.to_i }.sort else [] end end def schema_migrations_table_name ActiveRecord::Base.table_name_prefix + "data_migrations" + ActiveRecord::Base.table_name_suffix end def migrations_path DataMigrate.config.data_migrations_path end ## # Provides the full migrations_path filepath # @return (String) def full_migrations_path File.join(Rails.root, *migrations_path.split(File::SEPARATOR)) end def assure_data_schema_table ActiveRecord::Base.establish_connection(db_config) sm_table = DataMigrate::DataMigrator.schema_migrations_table_name unless table_exists?(ActiveRecord::Base.connection, sm_table) create_table(sm_table) end end ## # Compares the given filename with what we expect data migration # filenames to be, eg the "20091231235959_some_name.rb" pattern # @param (String) filename # @return (MatchData) def match(filename) /(\d{14})_(.+)\.rb$/.match(filename) end private def create_table(sm_table) ActiveRecord::Base.connection.create_table(sm_table, id: false) do |schema_migrations_table| schema_migrations_table.column :version, :string, null: false end suffix = ActiveRecord::Base.table_name_suffix prefix = ActiveRecord::Base.table_name_prefix index_name = "#{prefix}unique_data_migrations#{suffix}" options = {unique: true, name: index_name} options[:length] = 191 if ActiveRecord::Base.connection_config[:adapter] == "mysql2" ActiveRecord::Base.connection.add_index sm_table, :version, options end def table_exists?(connection, table_name) # Avoid the warning that table_exists? prints in Rails 5.0 due a # change in behavior between Rails 5.0 and Rails 5.1 of this method # with respect to database views. if ActiveRecord.version >= Gem::Version.new("5.0") && ActiveRecord.version < Gem::Version.new("5.1") connection.data_source_exists?(table_name) else connection.table_exists?(schema_migrations_table_name) end end def db_config ActiveRecord::Base.configurations[Rails.env || "development"] || ENV["DATABASE_URL"] end end end end ruby-data-migrate-5.3.1/lib/data_migrate/schema_migration.rb0000644000175000017500000000165613417546235022503 0ustar aleealeemodule DataMigrate # Helper class to getting access to db schema # to allow data/schema combiation tasks class SchemaMigration def self.pending_schema_migrations all_migrations = DataMigrate::DataMigrator.migrations(migrations_paths) sort_migrations( ActiveRecord::Migrator.new(:up, all_migrations). pending_migrations. map {|m| { version: m.version, kind: :schema }} ) end def self.run(direction, migration_paths, version) ActiveRecord::Migrator.run(direction, migration_paths, version) end def self.sort_migrations(set1, set2 = nil) migrations = set1 + (set2 || []) migrations.sort {|a, b| sort_string(a) <=> sort_string(b)} end def self.migrations_paths Rails.application.config.paths["db/migrate"].to_a end def self.sort_string(migration) "#{migration[:version]}_#{migration[:kind] == :data ? 1 : 0}" end end end ruby-data-migrate-5.3.1/lib/data_migrate/data_migrator_five.rb0000644000175000017500000000510513417546235023011 0ustar aleealee# frozen_string_literal: true require "active_record" require "data_migrate/config" module DataMigrate class DataMigrator < ActiveRecord::Migrator self.migrations_paths = [DataMigrate.config.data_migrations_path] def self.assure_data_schema_table ActiveRecord::Base.establish_connection(db_config) DataMigrate::DataSchemaMigration.create_table end def initialize(direction, migrations, target_version = nil) @direction = direction @target_version = target_version @migrated_versions = nil @migrations = migrations validate(@migrations) DataMigrate::DataSchemaMigration.create_table ActiveRecord::InternalMetadata.create_table end def load_migrated @migrated_versions = DataMigrate::DataSchemaMigration.normalized_versions.map(&:to_i).sort end class << self def current_version DataMigrate::MigrationContext.new(migrations_paths).current_version end ## # Compares the given filename with what we expect data migration # filenames to be, eg the "20091231235959_some_name.rb" pattern # @param (String) filename # @return (MatchData) def match(filename) /(\d{14})_(.+)\.rb/.match(filename) end ## # Provides the full migrations_path filepath # @return (String) def full_migrations_path File.join(Rails.root, *migrations_paths.split(File::SEPARATOR)) end def migrations_status DataMigrate::MigrationContext.new(migrations_paths).migrations_status end #TODO: this was added to be backward compatible, need to re-evaluate def migrations(_migrations_paths) DataMigrate::MigrationContext.new(migrations_paths).migrations end #TODO: this was added to be backward compatible, need to re-evaluate def run(direction, migration_paths, version) DataMigrate::MigrationContext.new(migration_paths).run(direction, version) end def rollback(migrations_path, steps) DataMigrate::MigrationContext.new(migrations_path).rollback(steps) end def db_config ActiveRecord::Base.configurations[Rails.env || "development"] || ENV["DATABASE_URL"] end end private def record_version_state_after_migrating(version) if down? migrated.delete(version) DataMigrate::DataSchemaMigration.where(version: version.to_s).delete_all else migrated << version DataMigrate::DataSchemaMigration.create!(version: version.to_s) end end end end ruby-data-migrate-5.3.1/lib/data_migrate/migration_context.rb0000644000175000017500000000474413417546235022730 0ustar aleealeemodule DataMigrate class MigrationContext < ActiveRecord::MigrationContext def initialize(migrations_paths = "db/data") @migrations_paths = migrations_paths || "db/data" end def up(target_version = nil) selected_migrations = if block_given? migrations.select { |m| yield m } else migrations end DataMigrator.new(:up, selected_migrations, target_version).migrate end def down(target_version = nil) selected_migrations = if block_given? migrations.select { |m| yield m } else migrations end DataMigrator.new(:down, selected_migrations, target_version).migrate end def run(direction, target_version) DataMigrator.new(direction, migrations, target_version).run end def current_version get_all_versions.max || 0 rescue ActiveRecord::NoDatabaseError end def migration_files paths = Array(migrations_paths) Dir[*paths.flat_map { |path| "#{path}/**/[0-9]*_*.rb" }] end def migrations_status db_list = DataSchemaMigration.normalized_versions file_list = migration_files.map do |file| version, name, scope = parse_migration_filename(file) raise ActiveRecord::IllegalMigrationNameError.new(file) unless version version = ActiveRecord::SchemaMigration.normalize_migration_number(version) status = db_list.delete(version) ? "up" : "down" [status, version, (name + scope).humanize] end.compact db_list.map! do |version| ["up", version, "********** NO FILE **********"] end (db_list + file_list).sort_by { |_, version, _| version } end private def get_all_versions if DataMigrate::DataSchemaMigration.table_exists? DataSchemaMigration.normalized_versions.map(&:to_i) else [] end end def move(direction, steps) migrator = DataMigrator.new(direction, migrations) if current_version != 0 && !migrator.current_migration raise ActiveRecord::UnknownMigrationVersionError.new(current_version) end start_index = if current_version.zero? 0 else migrator.migrations.index(migrator.current_migration) end finish = migrator.migrations[start_index + steps] version = finish ? finish.version : 0 send(direction, version) end end end ruby-data-migrate-5.3.1/lib/data_migrate/config.rb0000644000175000017500000000047113417546235020431 0ustar aleealeemodule DataMigrate include ActiveSupport::Configurable class << self def configure yield config end def config @config ||= Config.new end end class Config attr_accessor :data_migrations_path def initialize @data_migrations_path = "db/data/" end end end ruby-data-migrate-5.3.1/.rubocop.yml0000644000175000017500000000011113417546235015711 0ustar aleealee# Use same configration as used by HoundCI inherit_from: .ruby-style.yml ruby-data-migrate-5.3.1/.travis.yml0000644000175000017500000000033313417546235015556 0ustar aleealeelanguage: ruby rvm: - 2.2.9 - 2.3.7 - 2.4.4 - 2.5.1 script: bundle exec rspec gemfile: - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile - gemfiles/rails_5.2.gemfile ruby-data-migrate-5.3.1/README.md0000644000175000017500000002023413417546235014726 0ustar aleealeeData Migrate ==== - [![Version](http://img.shields.io/gem/v/data_migrate.svg?style=flat-square)](https://rubygems.org/gems/data_migrate) - [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://opensource.org/licenses/MIT) - [![Travis](https://img.shields.io/travis/ilyakatz/data-migrate.svg)](https://travis-ci.org/ilyakatz/data-migrate) - [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) Run data migrations alongside schema migrations. Data migrations are stored in `db/data`. They act like schema migrations, except they should be reserved for data migrations. For instance, if you realize you need to titleize all your titles, this is the place to do it. ![Travis](./screenshot.png) # Why should I use this? Its seems when a project hits a certain size, I get to manipulate data outside the application itself. Changing defaults, new validations, one-to-one to one-to-many... I found it a pain and dodgy to have to step up migrations one by one, run a ruby script of some sort, then resume migrations. It tanks a lot of the automation of deploy. If you don't use the one off scripts, you could do it as a regular migration. It'd be much better to keep concerns separate. The benefit of having them separate has to do with your data model. For instance, lets take an absurd example, to illustrate: You have a blog application that has posts with many comments. After some use, you decide you are going to be a trend setter, and want only one comment per post, and just the text. Given that you: - write a migration to add a comment column to `Post` - write a migration to move the contents of the first comments to the `Post` - drop the `column_id` column from `Post` - drop the `Comment` model - fix all your tests You've just got bit. When you `rake setup:development`, the mess gets mad at you after it creates your database, and starts cranking through migrations. It gets to the part where you iterate over the comments and it blows up. You don't have a `Comment` model anymore for it to even try and get 'all' from. You think you are smarter, and wrap the ActiveRecord call in a conditional based on the environment. That's fine until you get that QA gal, and she wants her own thing. Then the UI people get tired of waiting for the full stack to load on page refreshes, so you have to edit past migrations... With Data Migrate, you have the control. You can generate your migrations as schema or data as you would as your work flow. For setting tasks that don't require any intermediate AR activity, like dev and test, you stick with `db:migrate`. For production and QA, you change their scripts to `db:migrate:with_data`. Of course you want to test your migration, so you have the choice of `db:migrate:with_data` or `data:migrate` to just capture that data change. ## What does it do? Data migrations are stored in `db/data`. They act like schema migrations, except they should be reserved for data migrations. For instance, if you realize you need to titleize all yours titles, this is the place to do it. Running any of the provided rake tasks also creates a data schema table to mirror the usual schema migrations table to track all the goodness. ## Rails Support Support Rails 4.2 through 5.2 ### Important notes for older versions #### v2 If you upgraded to Rails 4 while using `data_migrate` prior to version 2, the gem wrote data migration versions into `schema_migrations` table. After the fix, it was corrected to write into `data_migrations`. If you need to use these old migrations, add the following configuration It is recommended to move all legacy migrations from `schema_migrations` table into `data_migrations` table This may cause some unintended consequences. See [#22](https://github.com/ilyakatz/data-migrate/issues/22) #### v1 If you've installed previous to v1.1.0, you'll want to delete the `create_data_migrations_table` migration. ## Installation Add the gem to your project # Gemfile gem 'data_migrate' Then `bundle install` and you are ready to go. So you know, when you use one of the provide rake tasks, a table called `data_migrations` will be created in your database. This is to mirror the way the standard `db` rake tasks work. ## Usage ### Generating Migrations You can generate a data migration as you would a schema migration: rails g data_migration add_this_to_that ### Rake Tasks $> rake -T data rake data:dump # Create a db/data_schema.rb file that stores the current data version rake data:forward # Pushes the schema to the next version (specify steps w/ STEP=n) rake data:migrate # Migrate data migrations (options: VERSION=x, VERBOSE=false) rake data:migrate:down # Runs the "down" for a given migration VERSION rake data:migrate:redo # Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x) rake data:migrate:status # Display status of data migrations rake data:migrate:up # Runs the "up" for a given migration VERSION rake data:rollback # Rolls the schema back to the previous version (specify steps w/ STEP=n) rake data:version # Retrieves the current schema version number for data migrations rake db:forward:with_data # Pushes the schema to the next version (specify steps w/ STEP=n) rake db:migrate:down:with_data # Runs the "down" for a given migration VERSION rake db:migrate:redo:with_data # Rollbacks the database one migration and re migrate up (options: STEP=x, VERSION=x) rake db:migrate:status:with_data # Display status of data and schema migrations rake db:migrate:up:with_data # Runs the "up" for a given migration VERSION rake db:migrate:with_data # Migrate the database data and schema (options: VERSION=x, VERBOSE=false) rake db:rollback:with_data # Rolls the schema back to the previous version (specify steps w/ STEP=n) rake db:schema:load:with_data # Load both schema.rb and data_schema.rb files into the database rake db:structure:load:with_data # Load both structure.sql and data_schema.rb files into the database rake db:version:with_data # Retrieves the current schema version numbers for data and schema migrations Tasks work as they would with the 'vanilla' db version. The 'with_data' addition to the 'db' tasks will run the task in the context of both the data and schema migrations. That is, rake db:rollback:with_data will check to see if it was a schema or data migration invoked last, and do that. Tasks invoked in that space also have an additional line of output, indicating if the action is performed on data or schema. With 'up' and 'down', you can specify the option 'BOTH', which defaults to false. Using true, will migrate both the data and schema (in the desired direction) if they both match the version provided. Again, going up, schema is given precedence. Down its data. `rake db:migrate:status:with_data` provides and additional column to indicate which type of migration. ### Configuration `data_migrate` respects `ActiveRecord::Base.dump_schema_after_migration`. If it is set to `false`, data schema file will not be generated By default, data migrations are added to the `db/data/` path. You can override this setting in `config/initializers/data_migrate.rb` ```ruby DataMigrate.configure do |config| config.data_migrations_path = "db/awesomepath/" end ``` ## Capistrano Support The gem comes with a capistrano task that can be used instead of `capistrano/rails/migrations`. Just add this line to your Capfile: ```ruby require 'capistrano/data_migrate' ``` From now on capistrano will run `rake db:migrate:with_data` in every deploy. ### Contributing ## Testing Run tests for a specific version of Rails ``` bundle exec appraisal install bundle exec appraisal rails-4.2 rspec bundle exec appraisal rails-5.0 rspec ``` ## Thanks [Andrew J Vargo](http://github.com/ajvargo) Andrew was the original creator and maintainer of this project! [Jeremy Durham](http://jeremydurham.com/) for fleshing out the idea with me, and providing guidance. You! Yes, you. Thanks for checking it out. ruby-data-migrate-5.3.1/LICENSE0000644000175000017500000000206213374461640014451 0ustar aleealeeThe MIT License Copyright (c) 2011 Andrew J Vargo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.ruby-data-migrate-5.3.1/Gemfile0000644000175000017500000000014013374461640014732 0ustar aleealeesource "http://rubygems.org" # Specify your gem's dependencies in data_migrate.gemspec gemspec ruby-data-migrate-5.3.1/.overcommit.yml0000644000175000017500000000161213417546235016433 0ustar aleealee# Use this file to configure the Overcommit hooks you wish to use. This will # extend the default configuration defined in: # https://github.com/brigade/overcommit/blob/master/config/default.yml # # At the topmost level of this YAML file is a key representing type of hook # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can # customize each hook, such as whether to only run it on certain files (via # `include`), whether to only display output if it fails (via `quiet`), etc. # # For a complete list of hooks, see: # https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook # # For a complete list of options that you can use to customize hooks, see: # https://github.com/brigade/overcommit#configuration # # Uncomment the following lines to make the configuration take effect. PreCommit: RuboCop: enabled: true on_warn: fail # Treat all warnings as failuresruby-data-migrate-5.3.1/Appraisals0000644000175000017500000000042113417546235015465 0ustar aleealeeappraise 'rails-4.2' do gem 'rails', '4.2.8' # Nokogiri 1.7+ requires Ruby 2.1+ gem 'nokogiri', '1.6.8.1' end appraise 'rails-5.0' do gem 'rails', '5.0.3' end appraise 'rails-5.1' do gem 'rails', '5.1' end appraise 'rails-5.2' do gem 'rails', '~> 5.2.0' end ruby-data-migrate-5.3.1/Changelog.md0000644000175000017500000000343613417546235015665 0ustar aleealeeChangelog ========= ## 5.3.1 Change database task to use data_migrations_path_configuration ## 5.3.0 Add support to configure data migration path ## 5.1.0 Fixes to `db:schema:load:with_data` + `db:structure:load:with_data` definition, thanks to [craineum](https://github.com/craineum) ## 5.0.0 Remove support for legacy migrations (from v2). **IMPORTANT**: If you used this gem from before version 2, make sure to run migration script ``` DataMigrate::LegacyMigrator.new.migrate ``` **Failure to do so may cause re-running old migrations** ## 4.0.0 Support for Rails 5.2 Deprecated support for Rails 4.1 Internal changes to make data-migrate behavior more similar to Rails migrations ## 3.5.0 Deprecated support for rails 4.0 Improvements to timestamped migrations, thanks to [Pierre-Michard](https://github.com/Pierre-Michard) ## 3.4.0 `rake data:migrate:status` to return result in chronological order ## 3.3.1 Regression fix, thanks to [subakva](https://github.com/subakva) ## 3.3.0 The concept of schema:dump to data migrations, thanks to [tobyndockerill](https://github.com/tobyndockerill) ## 3.2.1 data_migrate table into rails schema dump, thanks to [jturkel](https://github.com/jturkel) ## 3.2.0 - Add support for Rails 5.1 - No longer testing EOL rubies ## 3.1.0 Rails 5.0 support thanks to [jturkel](https://github.com/jturkel) and [abreckner](https://github.com/abreckner) ## 3.0.1 ([gacha](https://github.com/gacha)) Capistrano fixes ## 3.0.0 `--skip-schema-migration` removed deprecated. This gem will no longer generate schema migrations. It still supports running schema/data migrations with one command. ## 2.2.0 ([bilby91](https://github.com/bilby91)) Capistrano support ## 2.1.0 User `Rails.application.config.paths["db/migrate"]` instead of hard coded path to db migrations ruby-data-migrate-5.3.1/Gemfile.rails5.20000644000175000017500000000016613417546235016302 0ustar aleealeesource "http://rubygems.org" # Specify your gem's dependencies in data_migrate.gemspec gemspec gem 'rails', '~> 5.2' ruby-data-migrate-5.3.1/.rspec0000644000175000017500000000002413374461640014555 0ustar aleealee--color --format d