refactor: moved migrations to own crate
This commit is contained in:
parent
777d57512e
commit
4225ce3471
13 changed files with 799 additions and 15 deletions
|
|
@ -8,6 +8,7 @@ use serde::{Deserialize, Serialize};
|
|||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
#[sea_orm(unique)]
|
||||
pub name: String,
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.1
|
||||
|
||||
use chrono::NaiveDateTime;
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
|
@ -20,13 +19,12 @@ pub struct Model {
|
|||
pub c_size: i64,
|
||||
pub description: Option<String>,
|
||||
pub url: Option<String>,
|
||||
pub build_date: NaiveDateTime,
|
||||
pub build_date: DateTime,
|
||||
pub packager: Option<String>,
|
||||
pub pgp_sig: Option<String>,
|
||||
pub pgp_sig_size: Option<i64>,
|
||||
pub sha256_sum: String,
|
||||
pub compression: String,
|
||||
#[serde(skip_serializing)]
|
||||
pub state: PackageState,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ pub struct Model {
|
|||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub distro_id: i32,
|
||||
#[sea_orm(unique)]
|
||||
pub name: String,
|
||||
pub description: Option<String>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
pub mod entities;
|
||||
mod migrator;
|
||||
pub mod query;
|
||||
|
||||
use crate::config::DbConfig;
|
||||
|
||||
pub use entities::{prelude::*, *};
|
||||
pub use migrator::Migrator;
|
||||
|
||||
use sea_orm::{ConnectionTrait, Database, DbConn, DeriveActiveEnum, EnumIter};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue