Skip to main content

toasty_driver_integration_suite/scenarios/
two_models.rs

1use crate::prelude::*;
2
3scenario! {
4    #[derive(Debug, toasty::Model)]
5    struct User {
6        #[key]
7        #[auto]
8        id: uuid::Uuid,
9
10        #[index]
11        name: String,
12    }
13
14    #[derive(Debug, toasty::Model)]
15    struct Post {
16        #[key]
17        #[auto]
18        id: uuid::Uuid,
19
20        #[index]
21        title: String,
22    }
23
24    async fn setup(test: &mut Test) -> toasty::Db {
25        test.setup_db(models!(User, Post)).await
26    }
27}