Commit eca5927
committed
Use the same create database option as Rails Rakefile
* DEFAULT CHARACTER SET utf8mb4 for MySQL
https://github.com/rails/rails/blob/5431e17733366da1fd10f2cd3039d66a56012683/activerecord/Rakefile#L97-L98
```
%x( mysql --user=#{config["arunit"]["username"]} --password=#{config["arunit"]["password"]} -e "create DATABASE #{config["arunit"]["database"]} DEFAULT CHARACTER SET utf8mb4" )
%x( mysql --user=#{config["arunit2"]["username"]} --password=#{config["arunit2"]["password"]} -e "create DATABASE #{config["arunit2"]["database"]} DEFAULT CHARACTER SET utf8mb4" )
```
* Do not specify `DEFAULT COLLATE` as Rails Raketask removed
rails/rails@d54d0c9#diff-6c25b8e13c63a297ab5298948548caef
> There should be no "one size fits all" collation in MySQL 5.7.
> Let MySQL server choose the default collation for Active Record
> unit test databases.
* Use `-E UTF8 -T template0` option for PostgreSQL database
https://github.com/rails/rails/blob/5431e17733366da1fd10f2cd3039d66a56012683/activerecord/Rakefile#L116-L117
```
%x( createdb -E UTF8 -T template0 #{config["arunit"]["database"]} )
%x( createdb -E UTF8 -T template0 #{config["arunit2"]["database"]} )
```1 parent c1d0670 commit eca5927
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments