Sha256: 0f9b8a62cd7b377e1f074237ee7ed874576a9640a169238c20b9bcd0f2b8bc86

Contents?: true

Size: 697 Bytes

Versions: 1

Compression:

Stored size: 697 Bytes

Contents

# frozen_string_literal: true

require "rails/generators/active_record"

module AcidicJob
	module Generators
		class DropTablesGenerator < ::Rails::Generators::Base
			include ActiveRecord::Generators::Migration
			source_root File.expand_path("templates", __dir__)

			desc "Drops the pre-1.0 tables for the AcidicJob::Key and AcidicJob::Staged models."

			def copy_migration
				migration_template "drop_acidic_job_keys_migration.rb.erb",
													 "db/migrate/drop_old_acidic_job_tables.rb",
													 migration_version: migration_version
			end
			
			protected
			
			def migration_version
				"[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acidic_job-1.0.0.pre4 lib/generators/acidic_job/drop_tables_generator.rb