Skip to content

Commit

Permalink
Refactor Schema (SeaQL/sea-orm#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Nov 17, 2021
1 parent 47c3564 commit ed10908
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion SeaORM/docs/06-write-test/03-sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ To create tables in SQLite database for testing, instead of writing [`TableCreat
```rust
async fn setup_schema(db: &DbConn) {

// Setup Schema helper
let schema = Schema::new(DbBackend::Sqlite);

// Derive from Entity
let stmt: TableCreateStatement = Schema::create_table_from_entity(MyEntity);
let stmt: TableCreateStatement = schema.create_table_from_entity(MyEntity);

// Or setup manually
assert_eq!(
Expand Down

0 comments on commit ed10908

Please sign in to comment.