File tree Expand file tree Collapse file tree 5 files changed +43
-0
lines changed
print_schema/print_schema_datetime_for_mysql Expand file tree Collapse file tree 5 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ fn mysql_diesel_types() -> HashSet<&'static str> {
144
144
145
145
types. insert ( "TinyInt" ) ;
146
146
types. insert ( "Tinyint" ) ;
147
+ types. insert ( "Datetime" ) ;
148
+ types. insert ( "Json" ) ;
147
149
types
148
150
}
149
151
Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ fn print_schema_unsigned() {
124
124
test_print_schema ( "print_schema_unsigned" , vec ! [ "--with-docs" ] ) ;
125
125
}
126
126
127
+ #[ test]
128
+ #[ cfg( feature = "mysql" ) ]
129
+ fn print_schema_datetime_for_mysql ( ) {
130
+ test_print_schema ( "print_schema_datetime_for_mysql" , vec ! [ "--with-docs" ] ) ;
131
+ }
132
+
127
133
#[ test]
128
134
#[ cfg( not( windows) ) ]
129
135
fn print_schema_patch_file ( ) {
Original file line number Diff line number Diff line change
1
+ [print_schema ]
2
+ file = " src/schema.rs"
3
+ with_docs = true
Original file line number Diff line number Diff line change
1
+ // @generated automatically by Diesel CLI.
2
+
3
+ diesel:: table! {
4
+ /// Representation of the `users` table.
5
+ ///
6
+ /// (Automatically generated by Diesel.)
7
+ users ( id) {
8
+ /// The `id` column of the `users` table.
9
+ ///
10
+ /// Its SQL type is `Integer`.
11
+ ///
12
+ /// (Automatically generated by Diesel.)
13
+ id -> Integer ,
14
+ /// The `datetime` column of the `users` table.
15
+ ///
16
+ /// Its SQL type is `Datetime`.
17
+ ///
18
+ /// (Automatically generated by Diesel.)
19
+ datetime -> Datetime ,
20
+ /// The `nullable_datetime` column of the `users` table.
21
+ ///
22
+ /// Its SQL type is `Nullable<Datetime>`.
23
+ ///
24
+ /// (Automatically generated by Diesel.)
25
+ nullable_datetime -> Nullable <Datetime >,
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ CREATE TABLE users (
2
+ id INTEGER PRIMARY KEY ,
3
+ datetime DATETIME NOT NULL ,
4
+ nullable_datetime DATETIME
5
+ );
You can’t perform that action at this time.
0 commit comments