1.2.5
This commit is contained in:
parent
f71de5c149
commit
df92d7d31f
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2590,7 +2590,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sr_download"
|
name = "sr_download"
|
||||||
version = "1.2.4"
|
version = "1.2.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"axum",
|
"axum",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "sr_download"
|
name = "sr_download"
|
||||||
version = "1.2.4"
|
version = "1.2.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "sr_download"
|
default-run = "sr_download"
|
||||||
|
|
||||||
|
@ -20,7 +20,17 @@ pub mod db_names {
|
|||||||
pub const SEA_ORM_TABLE: &str = "seaql_migrations";
|
pub const SEA_ORM_TABLE: &str = "seaql_migrations";
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const CURRENT_DB_VERSION: i32 = 1;
|
/// 当前数据库版本 (用于检查是否需要更新)
|
||||||
|
///
|
||||||
|
/// ## 版本历史
|
||||||
|
/// 1. 原始版本, 基于 sea_orm 的版本
|
||||||
|
/// 2. 初始版本, 开始自己写定义了
|
||||||
|
/// 各个表的信息可以在对应的文件中查看
|
||||||
|
/// - `main_data` 表
|
||||||
|
/// - `long_data` 表
|
||||||
|
/// - `full_data` 视图
|
||||||
|
/// - `ships` 表
|
||||||
|
pub const CURRENT_DB_VERSION: i32 = 2;
|
||||||
|
|
||||||
pub const TEXT_DATA_MAX_LEN: usize = 1024;
|
pub const TEXT_DATA_MAX_LEN: usize = 1024;
|
||||||
pub type SaveId = u32;
|
pub type SaveId = u32;
|
||||||
|
@ -25,7 +25,12 @@ pub fn main_table() -> Statement {
|
|||||||
.col(ColumnDef::new(MainData::BlakeHash).char_len(64).not_null())
|
.col(ColumnDef::new(MainData::BlakeHash).char_len(64).not_null())
|
||||||
.col(ColumnDef::new(MainData::Len).big_integer().not_null())
|
.col(ColumnDef::new(MainData::Len).big_integer().not_null())
|
||||||
.col(ColumnDef::new(MainData::ShortData).string_len(TEXT_DATA_MAX_LEN as u32))
|
.col(ColumnDef::new(MainData::ShortData).string_len(TEXT_DATA_MAX_LEN as u32))
|
||||||
.col(ColumnDef::new(MainData::XmlTested).boolean().null());
|
.col(ColumnDef::new(MainData::XmlTested).boolean().null())
|
||||||
|
.col(
|
||||||
|
ColumnDef::new(MainData::Time)
|
||||||
|
.timestamp_with_time_zone()
|
||||||
|
.not_null(),
|
||||||
|
);
|
||||||
DatabaseBackend::Postgres.build(&table)
|
DatabaseBackend::Postgres.build(&table)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,4 +78,8 @@ pub enum MainData {
|
|||||||
ShortData,
|
ShortData,
|
||||||
/// 数据是不是合法的 XML 数据
|
/// 数据是不是合法的 XML 数据
|
||||||
XmlTested,
|
XmlTested,
|
||||||
|
/// 加入数据的时间
|
||||||
|
/// 用于记录一些有趣的东西
|
||||||
|
/// 加入于 版本号 2
|
||||||
|
Time,
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,15 @@ pub fn ships_table() -> Statement {
|
|||||||
.from(Ships::Table, Ships::SaveId)
|
.from(Ships::Table, Ships::SaveId)
|
||||||
.on_delete(ForeignKeyAction::Cascade)
|
.on_delete(ForeignKeyAction::Cascade)
|
||||||
.on_update(ForeignKeyAction::Cascade),
|
.on_update(ForeignKeyAction::Cascade),
|
||||||
|
)
|
||||||
|
.col(ColumnDef::new(Ships::Mass).big_integer().not_null())
|
||||||
|
.col(ColumnDef::new(Ships::ModUsed).boolean().not_null())
|
||||||
|
.col(
|
||||||
|
ColumnDef::new(Ships::DocxConnectionUsed)
|
||||||
|
.boolean()
|
||||||
|
.not_null(),
|
||||||
);
|
);
|
||||||
|
// .col(ColumnDef::new(Ships::XmlData));
|
||||||
DatabaseBackend::Postgres.build(&table)
|
DatabaseBackend::Postgres.build(&table)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user