Skip to content

Commit 03547e1

Browse files
add multirange to diesel_cli
1 parent f17e60c commit 03547e1

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

diesel_cli/src/print_schema.rs

+6
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ fn pg_diesel_types() -> HashSet<&'static str> {
115115
types.insert("Numrange");
116116
types.insert("Tsrange");
117117
types.insert("Tstzrange");
118+
types.insert("Int4multirange");
119+
types.insert("Int8multirange");
120+
types.insert("Datemultirange");
121+
types.insert("Nummultirange");
122+
types.insert("Tsmultirange");
123+
types.insert("Tstzmultirange");
118124
types.insert("SmallSerial");
119125
types.insert("BigSerial");
120126
types.insert("Serial");

diesel_cli/tests/generate_migrations/diff_add_table_all_the_types/postgres/schema.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
table! {
42
all_the_types(id) {
53
id -> Integer,
@@ -39,6 +37,11 @@ table! {
3937
daterange_col -> Daterange,
4038
tsrange_col -> Tsrange,
4139
tstzrange_col -> Tstzrange,
40+
int4multirange_col -> Int4multirange,
41+
int8multirange_col -> Int8multirange,
42+
datemultirange_col -> Datemultirange,
43+
tsmultirange_col -> Tsmultirange,
44+
tstzmultirange_col -> Tstzmultirange,
4245
small_serial_col -> SmallSerial,
4346
big_serial_col -> BigSerial,
4447
serial_col -> Serial,

diesel_cli/tests/generate_migrations/diff_add_table_all_the_types/postgres/schema_out.rs/expected.snap

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ diesel::table! {
4545
daterange_col -> Daterange,
4646
tsrange_col -> Tsrange,
4747
tstzrange_col -> Tstzrange,
48+
int4multirange_col -> Int4multirange,
49+
int8multirange_col -> Int8multirange,
50+
datemultirange_col -> Datemultirange,
51+
tsmultirange_col -> Tsmultirange,
52+
tstzmultirange_col -> Tstzmultirange,
4853
small_serial_col -> Int2,
4954
big_serial_col -> Int8,
5055
serial_col -> Int4,

diesel_cli/tests/generate_migrations/diff_add_table_all_the_types/postgres/up.sql/expected.snap

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
source: diesel_cli/tests/migration_generate.rs
3-
assertion_line: 333
43
description: "Test: diff_add_table_all_the_types"
54
---
65
-- Your SQL goes here
@@ -42,11 +41,14 @@ CREATE TABLE "all_the_types"(
4241
"daterange_col" DATERANGE NOT NULL,
4342
"tsrange_col" TSRANGE NOT NULL,
4443
"tstzrange_col" TSTZRANGE NOT NULL,
44+
"int4multirange_col" INT4MULTIRANGE NOT NULL,
45+
"int8multirange_col" INT8MULTIRANGE NOT NULL,
46+
"datemultirange_col" DATEMULTIRANGE NOT NULL,
47+
"tsmultirange_col" TSMULTIRANGE NOT NULL,
48+
"tstzmultirange_col" TSTZMULTIRANGE NOT NULL,
4549
"small_serial_col" SMALLSERIAL NOT NULL,
4650
"big_serial_col" BIGSERIAL NOT NULL,
4751
"serial_col" SERIAL NOT NULL,
4852
"bytea_col" BYTEA NOT NULL,
4953
"macaddr2_col" MACADDR NOT NULL
5054
);
51-
52-

0 commit comments

Comments
 (0)