mirror of
https://github.com/OMGeeky/twitch_backup.local_db.git
synced 2025-12-26 17:02:39 +01:00
make tasks id pk and add serde::Serialize to tasks and services
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "twba-local-db"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
@@ -14,6 +14,8 @@ thiserror = "1.0"
|
||||
futures = "0.3"
|
||||
tracing = "0.1"
|
||||
|
||||
serde = "1.0"
|
||||
|
||||
anyhow = { version = "1.0", optional = true }
|
||||
tracing-subscriber = { version = "0.3", optional = true }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize)]
|
||||
#[sea_orm(table_name = "services")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, serde::Serialize)]
|
||||
#[sea_orm(table_name = "tasks")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
|
||||
@@ -26,7 +26,13 @@ impl MigrationTrait for Migration {
|
||||
.create_table(
|
||||
Table::create()
|
||||
.table(Tasks::Table)
|
||||
.col(ColumnDef::new(Tasks::Id).integer().not_null())
|
||||
.col(
|
||||
ColumnDef::new(Tasks::Id)
|
||||
.integer()
|
||||
.not_null()
|
||||
.auto_increment()
|
||||
.primary_key(),
|
||||
)
|
||||
.col(ColumnDef::new(Tasks::ServiceId).integer().not_null())
|
||||
.col(ColumnDef::new(Tasks::Description).string().null())
|
||||
.col(ColumnDef::new(Tasks::Progress).big_integer().default(0))
|
||||
|
||||
Reference in New Issue
Block a user