mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
f2c29ec27b
commit
bdc8818330
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue