aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-01-19 11:40:59 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-01-19 12:37:09 +0900
commitbdc8818330ec051cd226590e9539588e492e3c9d (patch)
tree772b57b99eacab062583df6a0bebb9cb530739b1 /railties/test/application
parentf2c29ec27b058e115e969833d8ddb9bebc2ac901 (diff)
downloadrails-bdc8818330ec051cd226590e9539588e492e3c9d.tar.gz
rails-bdc8818330ec051cd226590e9539588e492e3c9d.tar.bz2
rails-bdc8818330ec051cd226590e9539588e492e3c9d.zip
update CREATE TABLE statements generated by `sqlite3` command
From SQLite 3.16.0, `IF NOT EXISTS` set to CREATE TABLE statements. Ref: https://www.sqlite.org/src/info/c7021960f5c070fb Fixes #27635.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/rake/dbs_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb
index 51db634b75..8bbae64d5e 100644
--- a/railties/test/application/rake/dbs_test.rb
+++ b/railties/test/application/rake/dbs_test.rb
@@ -175,7 +175,7 @@ module ApplicationTests
`bin/rails generate model book title:string;
bin/rails db:migrate db:structure:dump`
structure_dump = File.read("db/structure.sql")
- assert_match(/CREATE TABLE \"books\"/, structure_dump)
+ assert_match(/CREATE TABLE (?:IF NOT EXISTS )?\"books\"/, structure_dump)
`bin/rails environment db:drop db:structure:load`
assert_match expected_database, ActiveRecord::Base.connection_config[:database]
require "#{app_path}/app/models/book"
@@ -203,7 +203,7 @@ module ApplicationTests
stderr_output = capture(:stderr) { `bin/rails db:structure:dump` }
assert_empty stderr_output
structure_dump = File.read("db/structure.sql")
- assert_match(/CREATE TABLE \"posts\"/, structure_dump)
+ assert_match(/CREATE TABLE (?:IF NOT EXISTS )?\"posts\"/, structure_dump)
end
end