@@ -11,56 +11,56 @@ pub type ConnectionType = diesel::r2d2::PooledConnection<diesel::r2d2::Connectio
1111pub struct Todos {
1212 /// Field representing column `id`
1313 pub id : i32 ,
14- /// Field representing column `unsigned`
15- pub unsigned : u32 ,
16- /// Field representing column `unsigned_nullable`
17- pub unsigned_nullable : Option < u32 > ,
1814 /// Field representing column `text`
1915 pub text : String ,
2016 /// Field representing column `completed`
2117 pub completed : bool ,
2218 /// Field representing column `type`
2319 pub type_ : String ,
20+ /// Field representing column `smallint`
21+ pub smallint : i16 ,
22+ /// Field representing column `bigint`
23+ pub bigint : i64 ,
2424 /// Field representing column `created_at`
2525 pub created_at : chrono:: DateTime < chrono:: Utc > ,
2626 /// Field representing column `updated_at`
27- pub updated_at : chrono:: DateTime < chrono :: Utc > ,
27+ pub updated_at : chrono:: NaiveDateTime ,
2828}
2929
3030/// Create Struct for a row in table `todos` for [`Todos`]
3131#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize , diesel:: Insertable ) ]
3232#[ diesel( table_name=todos) ]
3333pub struct CreateTodos {
34- /// Field representing column `unsigned`
35- pub unsigned : u32 ,
36- /// Field representing column `unsigned_nullable`
37- pub unsigned_nullable : Option < u32 > ,
3834 /// Field representing column `text`
3935 pub text : String ,
4036 /// Field representing column `completed`
4137 pub completed : bool ,
4238 /// Field representing column `type`
4339 pub type_ : String ,
40+ /// Field representing column `smallint`
41+ pub smallint : i16 ,
42+ /// Field representing column `bigint`
43+ pub bigint : i64 ,
4444}
4545
4646/// Update Struct for a row in table `todos` for [`Todos`]
4747#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize , diesel:: AsChangeset , PartialEq , Default ) ]
4848#[ diesel( table_name=todos) ]
4949pub struct UpdateTodos {
50- /// Field representing column `unsigned`
51- pub unsigned : Option < u32 > ,
52- /// Field representing column `unsigned_nullable`
53- pub unsigned_nullable : Option < Option < u32 > > ,
5450 /// Field representing column `text`
5551 pub text : Option < String > ,
5652 /// Field representing column `completed`
5753 pub completed : Option < bool > ,
5854 /// Field representing column `type`
5955 pub type_ : Option < String > ,
56+ /// Field representing column `smallint`
57+ pub smallint : Option < i16 > ,
58+ /// Field representing column `bigint`
59+ pub bigint : Option < i64 > ,
6060 /// Field representing column `created_at`
6161 pub created_at : Option < chrono:: DateTime < chrono:: Utc > > ,
6262 /// Field representing column `updated_at`
63- pub updated_at : Option < chrono:: DateTime < chrono :: Utc > > ,
63+ pub updated_at : Option < chrono:: NaiveDateTime > ,
6464}
6565
6666/// Result of a `.paginate` function
@@ -134,16 +134,6 @@ impl Todos {
134134 if let Some ( filter_id) = filter. id . clone ( ) {
135135 query = query. filter ( crate :: schema:: todos:: id. eq ( filter_id) ) ;
136136 }
137- if let Some ( filter_unsigned) = filter. unsigned . clone ( ) {
138- query = query. filter ( crate :: schema:: todos:: unsigned. eq ( filter_unsigned) ) ;
139- }
140- if let Some ( filter_unsigned_nullable) = filter. unsigned_nullable . clone ( ) {
141- query = if filter_unsigned_nullable. is_some ( ) {
142- query. filter ( crate :: schema:: todos:: unsigned_nullable. eq ( filter_unsigned_nullable) )
143- } else {
144- query. filter ( crate :: schema:: todos:: unsigned_nullable. is_null ( ) )
145- } ;
146- }
147137 if let Some ( filter_text) = filter. text . clone ( ) {
148138 query = query. filter ( crate :: schema:: todos:: text. eq ( filter_text) ) ;
149139 }
@@ -153,6 +143,12 @@ impl Todos {
153143 if let Some ( filter_type_) = filter. type_ . clone ( ) {
154144 query = query. filter ( crate :: schema:: todos:: type_. eq ( filter_type_) ) ;
155145 }
146+ if let Some ( filter_smallint) = filter. smallint . clone ( ) {
147+ query = query. filter ( crate :: schema:: todos:: smallint. eq ( filter_smallint) ) ;
148+ }
149+ if let Some ( filter_bigint) = filter. bigint . clone ( ) {
150+ query = query. filter ( crate :: schema:: todos:: bigint. eq ( filter_bigint) ) ;
151+ }
156152 if let Some ( filter_created_at) = filter. created_at . clone ( ) {
157153 query = query. filter ( crate :: schema:: todos:: created_at. eq ( filter_created_at) ) ;
158154 }
@@ -180,11 +176,11 @@ impl Todos {
180176#[ derive( Debug , Default , Clone ) ]
181177pub struct TodosFilter {
182178 pub id : Option < i32 > ,
183- pub unsigned : Option < u32 > ,
184- pub unsigned_nullable : Option < Option < u32 > > ,
185179 pub text : Option < String > ,
186180 pub completed : Option < bool > ,
187181 pub type_ : Option < String > ,
182+ pub smallint : Option < i16 > ,
183+ pub bigint : Option < i64 > ,
188184 pub created_at : Option < chrono:: DateTime < chrono:: Utc > > ,
189- pub updated_at : Option < chrono:: DateTime < chrono :: Utc > > ,
185+ pub updated_at : Option < chrono:: NaiveDateTime > ,
190186}
0 commit comments