toasty_driver_integration_suite/scenarios/
two_models.rs

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