Created
March 26, 2019 18:07
-
-
Save alexcameron89/9232a1f398ac713adcd02a4c1372b262 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
# Activate the gem you are reporting the issue against. | |
gem "activerecord", "5.2.2.1" | |
gem "pg" | |
end | |
require "active_record" | |
require "minitest/autorun" | |
require "logger" | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: "postgresql", database: "rails") | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
class CreateFoos < ActiveRecord::Migration[5.2] | |
def change | |
create_table :foos do |t| | |
t.numeric :bar, default: 0.0 | |
t.decimal :baz, default: 0.0 | |
end | |
end | |
end | |
class BugTest < Minitest::Test | |
def test_migration_up | |
CreateFoos.migrate(:up) | |
end | |
def test_migration_down | |
CreateFoos.migrate(:down) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment