Skip to content

Commit

Permalink
Merge f3f20e4 into aa1a4d8
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Aug 20, 2019
2 parents aa1a4d8 + f3f20e4 commit d4cd437
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 14 deletions.
32 changes: 19 additions & 13 deletions .travis.yml
Expand Up @@ -5,6 +5,8 @@ branches:
services:
- mysql
- postgresql
addons:
postgresql: '9.6'
before_script:
- mysql -e 'create database delayed_job_test;'
- mysql --version
Expand All @@ -18,12 +20,15 @@ gemfile: # Supported
- gemfiles/mysql2/4-2.gemfile
- gemfiles/mysql2/5-1.gemfile
- gemfiles/mysql2/5-2.gemfile
- gemfiles/mysql2/6-0.gemfile
- gemfiles/postgresql/4-2.gemfile
- gemfiles/postgresql/5-1.gemfile
- gemfiles/postgresql/5-2.gemfile
- gemfiles/postgresql/6-0.gemfile
- gemfiles/sqlite3/4-2.gemfile
- gemfiles/sqlite3/5-1.gemfile
- gemfiles/sqlite3/5-2.gemfile
- gemfiles/sqlite3/6-0.gemfile
rvm: # Supported
- 2.3.8
- 2.4.6
Expand All @@ -41,19 +46,20 @@ matrix:
- gemfile: gemfiles/mysql2/master.gemfile # Future
- gemfile: gemfiles/postgresql/master.gemfile # Future
- gemfile: gemfiles/sqlite3/master.gemfile # Future
# The two combinations below are currently broken. We should stop allowing
# failure as the issue is resolved. See:
# https://github.com/jruby/activerecord-jdbc-adapter/issues/700
- rvm: jruby-9.2.7.0
gemfile: gemfiles/mysql2/5-1.gemfile
- rvm: jruby-9.2.7.0
gemfile: gemfiles/postgresql/5-1.gemfile
- rvm: jruby-9.2.7.0
gemfile: gemfiles/mysql2/5-2.gemfile
- rvm: jruby-9.2.7.0
gemfile: gemfiles/postgresql/5-2.gemfile
- rvm: jruby-9.2.7.0
gemfile: gemfiles/sqlite3/5-2.gemfile

exclude:
- gemfile: gemfiles/mysql2/6-0.gemfile
rvm: 2.3.8
- gemfile: gemfiles/mysql2/6-0.gemfile
rvm: 2.4.6
- gemfile: gemfiles/postgresql/6-0.gemfile
rvm: 2.3.8
- gemfile: gemfiles/postgresql/6-0.gemfile
rvm: 2.4.6
- gemfile: gemfiles/sqlite3/6-0.gemfile
rvm: 2.3.8
- gemfile: gemfiles/sqlite3/6-0.gemfile
rvm: 2.4.6

include:
#
Expand Down
2 changes: 1 addition & 1 deletion delayed_job_active_record.gemspec
@@ -1,7 +1,7 @@
# frozen_string_literal: true

Gem::Specification.new do |spec|
spec.add_dependency "activerecord", [">= 3.0", "< 5.3"]
spec.add_dependency "activerecord", [">= 3.0", "< 6.1"]
spec.add_dependency "delayed_job", [">= 3.0", "< 5"]
spec.authors = ["Brian Ryckbost", "Matt Griffin", "Erik Michaels-Ober"]
spec.description = "ActiveRecord backend for Delayed::Job, originally authored by Tobias Lütke"
Expand Down
23 changes: 23 additions & 0 deletions gemfiles/mysql2/6-0.gemfile
@@ -0,0 +1,23 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rake"

group :test do
platforms :jruby do
gem "activerecord-jdbcmysql-adapter", "> 60.0.rc1"
end

platforms :ruby, :mswin, :mingw do
gem "mysql2"
end

gem "coveralls", require: false
gem "rspec", ">= 2.11"
gem "simplecov", require: false

gem "activerecord", "~> 6.0.0"
end

gemspec path: "../../"
2 changes: 2 additions & 0 deletions gemfiles/mysql2/master.gemfile
Expand Up @@ -20,4 +20,6 @@ group :test do
gem "activerecord", github: "rails"
end

gem "delayed_job", github: "collectiveidea/delayed_job"

gemspec path: "../../"
23 changes: 23 additions & 0 deletions gemfiles/postgresql/6-0.gemfile
@@ -0,0 +1,23 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rake"

group :test do
platforms :jruby do
gem "activerecord-jdbcpostgresql-adapter", "> 60.0.rc1"
end

platforms :ruby, :mswin, :mingw do
gem "pg", "~> 0.18"
end

gem "coveralls", require: false
gem "rspec", ">= 2.11"
gem "simplecov", require: false

gem "activerecord", "~> 6.0.0"
end

gemspec path: "../../"
2 changes: 2 additions & 0 deletions gemfiles/postgresql/master.gemfile
Expand Up @@ -20,4 +20,6 @@ group :test do
gem "activerecord", github: "rails"
end

gem "delayed_job", github: "collectiveidea/delayed_job"

gemspec path: "../../"
23 changes: 23 additions & 0 deletions gemfiles/sqlite3/6-0.gemfile
@@ -0,0 +1,23 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rake"

group :test do
platforms :jruby do
gem "activerecord-jdbcsqlite3-adapter", "> 60.0.rc1"
end

platforms :ruby, :mswin, :mingw do
gem "sqlite3", "~> 1.4"
end

gem "coveralls", require: false
gem "rspec", ">= 2.11"
gem "simplecov", require: false

gem "activerecord", "~> 6.0.0"
end

gemspec path: "../../"
2 changes: 2 additions & 0 deletions gemfiles/sqlite3/master.gemfile
Expand Up @@ -20,4 +20,6 @@ group :test do
gem "activerecord", github: "rails"
end

gem "delayed_job", github: "collectiveidea/delayed_job"

gemspec path: "../../"
14 changes: 14 additions & 0 deletions spec/helper.rb
Expand Up @@ -38,6 +38,20 @@
ActiveRecord::Base.logger = Delayed::Worker.logger
ActiveRecord::Migration.verbose = false

# MySQL 5.7 no longer supports null default values for the primary key
# Override the default primary key type in Rails <= 4.0
# https://stackoverflow.com/a/34555109
if db_adapter == "mysql2"
types = if defined?(ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter)
# ActiveRecord 3.2+
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES
else
# ActiveRecord < 3.2
ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES
end
types[:primary_key] = types[:primary_key].sub(" DEFAULT NULL", "")
end

migration_template = File.open("lib/generators/delayed_job/templates/migration.rb")

# need to eval the template with the migration_version intact
Expand Down

0 comments on commit d4cd437

Please sign in to comment.