Skip to content

Commit 2c9c07d

Browse files
committed
Use jsonb as json type in migrations on SQLite 3.45+
This doesn't actually matter except for documentation purposes, because SQLite doesn't treat json and jsonb differently. While here, have MySQL use the json type when testing in CI.
1 parent e62ee06 commit 2c9c07d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.rdoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ Note that these migrations require Sequel 4.35.0+.
474474
json_type = case database_type
475475
when :postgres
476476
:jsonb
477-
when :sqlite, :mysql
477+
when :sqlite
478+
sqlite_version >= 34500 ? :jsonb : :json
479+
when :mysql
478480
:json
479481
else
480482
String

spec/migrate/001_tables.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
json_type = case database_type
4545
when :postgres
4646
:jsonb
47-
when :sqlite, :mysql
47+
when :sqlite
48+
sqlite_version >= 34500 ? :jsonb : :json
49+
when :mysql
4850
:json
4951
else
5052
String

spec/migrate_ci/001_tables.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
when :postgres
5454
:jsonb
5555
when :sqlite
56+
sqlite_version >= 34500 ? :jsonb : :json
57+
when :mysql
5658
:json
5759
else
5860
String

0 commit comments

Comments
 (0)