Client side atproto account migrator in your web browser, along with services for backups and adversarial migrations. pdsmoover.com
pds atproto migrations moo cow
at HEAD 53 lines 1.4 kB view raw
1use chrono::{DateTime, Utc}; 2use serde::{Deserialize, Serialize}; 3use sqlx::FromRow; 4 5#[derive(Clone, Debug, PartialEq, PartialOrd, sqlx::Type, Deserialize, Serialize)] 6#[sqlx(type_name = "blob_type", rename_all = "lowercase")] 7pub enum BlobType { 8 Repo, 9 Blob, 10 Prefs, 11} 12 13impl BlobType { 14 pub fn to_string(&self) -> String { 15 match self { 16 BlobType::Repo => "repo".to_string(), 17 BlobType::Blob => "blob".to_string(), 18 BlobType::Prefs => "prefs".to_string(), 19 } 20 } 21} 22 23#[derive(Debug, Serialize, Deserialize, FromRow)] 24pub struct AccountModel { 25 pub id: i64, 26 pub did: String, 27 pub pds_host: String, 28 pub active: bool, 29 pub repo_rev: Option<String>, 30 /// If the whole PDS was signed up set this as true to know to clean up if the PDS is removed. 31 pub pds_sign_up: bool, 32 pub last_backup: Option<DateTime<Utc>>, 33 pub last_backup_started: Option<DateTime<Utc>>, 34 pub created_at: DateTime<Utc>, 35} 36 37#[derive(Debug, Serialize, Deserialize, FromRow)] 38pub struct BlobModel { 39 pub id: i32, 40 pub created_at: DateTime<Utc>, 41 pub account_did: String, 42 pub size: i64, 43 pub r#type: BlobType, 44 pub cid_or_rev: String, 45} 46 47#[derive(Debug, Serialize, Deserialize, FromRow)] 48pub struct PdsHostModel { 49 pub pds_host: String, 50 pub created: DateTime<Utc>, 51 pub active: bool, 52 pub admin_did: Option<String>, 53}