db: Change the version number from u8 to i16
This is the smallest integer compatible with all of MySQL, Postgres and SQlite. This is a backwards-compatible change for SQlite since both are represented as "integer", and all u8 values can be represented as i16.
This commit is contained in:
committed by
nitnelave
parent
260b545a54
commit
692bbb00f1
@@ -4,7 +4,7 @@ use sea_orm::Value;
|
||||
pub type DbConnection = sea_orm::DatabaseConnection;
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Debug, Clone)]
|
||||
pub struct SchemaVersion(pub u8);
|
||||
pub struct SchemaVersion(pub i16);
|
||||
|
||||
impl sea_orm::TryGetable for SchemaVersion {
|
||||
fn try_get(
|
||||
@@ -12,7 +12,7 @@ impl sea_orm::TryGetable for SchemaVersion {
|
||||
pre: &str,
|
||||
col: &str,
|
||||
) -> Result<Self, sea_orm::TryGetError> {
|
||||
Ok(SchemaVersion(u8::try_get(res, pre, col)?))
|
||||
Ok(SchemaVersion(i16::try_get(res, pre, col)?))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user