From 7d632fe501734a1a64b8ff374b5d79e27c53644f Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 4 Aug 2022 22:25:54 +0000 Subject: [PATCH] regen with uuids --- entities/src/block_list.rs | 4 ++-- entities/src/secondary_user.rs | 8 ++++---- entities/src/user.rs | 4 ++-- entities/src/user_keys.rs | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/entities/src/block_list.rs b/entities/src/block_list.rs index cbe82db3..b000e3d9 100644 --- a/entities/src/block_list.rs +++ b/entities/src/block_list.rs @@ -5,8 +5,8 @@ use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "block_list")] pub struct Model { - #[sea_orm(primary_key)] - pub id: i64, + #[sea_orm(primary_key, auto_increment = false)] + pub uuid: Vec, #[sea_orm(unique)] pub address: String, pub description: String, diff --git a/entities/src/secondary_user.rs b/entities/src/secondary_user.rs index 9be26c73..192f5c49 100644 --- a/entities/src/secondary_user.rs +++ b/entities/src/secondary_user.rs @@ -6,9 +6,9 @@ use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "secondary_user")] pub struct Model { - #[sea_orm(primary_key)] - pub id: i64, - pub user_id: i64, + #[sea_orm(primary_key, auto_increment = false)] + pub uuid: Vec, + pub user_id: Vec, pub address: String, pub description: String, pub email: String, @@ -20,7 +20,7 @@ pub enum Relation { #[sea_orm( belongs_to = "super::user::Entity", from = "Column::UserId", - to = "super::user::Column::Id", + to = "super::user::Column::Uuid", on_update = "NoAction", on_delete = "NoAction" )] diff --git a/entities/src/user.rs b/entities/src/user.rs index b75bf964..870d4ac4 100644 --- a/entities/src/user.rs +++ b/entities/src/user.rs @@ -5,8 +5,8 @@ use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "user")] pub struct Model { - #[sea_orm(primary_key)] - pub id: i64, + #[sea_orm(primary_key, auto_increment = false)] + pub uuid: Vec, #[sea_orm(unique)] pub address: String, pub description: String, diff --git a/entities/src/user_keys.rs b/entities/src/user_keys.rs index 660e88fa..f5e47eaa 100644 --- a/entities/src/user_keys.rs +++ b/entities/src/user_keys.rs @@ -5,9 +5,9 @@ use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "user_keys")] pub struct Model { - #[sea_orm(primary_key)] - pub id: i64, - pub user_id: i64, + #[sea_orm(primary_key, auto_increment = false)] + pub uuid: Vec, + pub user_uuid: Vec, #[sea_orm(unique)] pub api_key: String, pub description: String, @@ -19,8 +19,8 @@ pub struct Model { pub enum Relation { #[sea_orm( belongs_to = "super::user::Entity", - from = "Column::UserId", - to = "super::user::Column::Id", + from = "Column::UserUuid", + to = "super::user::Column::Uuid", on_update = "NoAction", on_delete = "NoAction" )]