File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -33,19 +33,21 @@ The schema lib's purpose is to define your microservice models which will be use
33
33
34
34
``` rust
35
35
// schema/src/lib.rs
36
-
37
- register_schemas! (Product );
38
-
39
- #[derive(Model )]
40
- pub struct Product {
41
- pub id : Uuid ,
42
- pub created_at : DateTime <FixedOffset >,
43
- pub updated_at : DateTime <FixedOffset >,
44
- pub name : String ,
45
- #[awto(max_len = 120)]
46
- pub description : Option <String >,
47
- #[awto(default = 0)]
48
- pub price : i64 ,
36
+ use awto :: prelude :: * ;
37
+
38
+ schema! {
39
+ #[database_table]
40
+ #[protobuf_message]
41
+ pub struct Product {
42
+ pub id : Uuid ,
43
+ pub created_at : DateTime <FixedOffset >,
44
+ pub updated_at : DateTime <FixedOffset >,
45
+ pub name : String ,
46
+ #[awto(max_len = 120)]
47
+ pub description : Option <String >,
48
+ #[awto(default = 0)]
49
+ pub price : i64 ,
50
+ }
49
51
}
50
52
```
51
53
You can’t perform that action at this time.
0 commit comments