The server can automatically generate models from a live database. This is useful to have models that actually match database types.
They can be generated using following command (for a local SQLite database):
sea-orm-cli generate entity --output-dir entity/src/entities/ --database-url sqlite://appledb.sqliteWhen using SQLite as a database for models generation,
INTEGER PRIMARY KEYis mapped to ani32type. We need i64 into our code to prevent overflows. A simple command can be applied to change these models:
find entity/src/entities/ -type f -name "*.rs" -exec sed -i 's/pub id: i32/pub id: i64/' {} +