From 6285923b200beaeb6001eceab05109dfb10d37bb Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Fri, 26 May 2023 14:22:05 -0700 Subject: [PATCH] Add compressed_seq for compression related asset fields --- .../src/dao/generated/asset.rs | 54 +------- .../src/dao/generated/asset_authority.rs | 17 +-- .../src/dao/generated/asset_creators.rs | 17 +-- .../src/dao/generated/asset_data.rs | 14 +- .../src/dao/generated/asset_grouping.rs | 17 +-- .../generated/asset_v1_account_attachments.rs | 17 +-- .../src/dao/generated/sea_orm_active_enums.rs | 126 +++++++++--------- 7 files changed, 77 insertions(+), 185 deletions(-) diff --git a/digital_asset_types/src/dao/generated/asset.rs b/digital_asset_types/src/dao/generated/asset.rs index 0afb21fab..bcb420019 100644 --- a/digital_asset_types/src/dao/generated/asset.rs +++ b/digital_asset_types/src/dao/generated/asset.rs @@ -43,6 +43,7 @@ pub struct Model { pub slot_updated: i64, pub data_hash: Option, pub creator_hash: Option, + pub compressed_seq: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] @@ -72,6 +73,7 @@ pub enum Column { SlotUpdated, DataHash, CreatorHash, + CompressedSeq, } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)] @@ -87,13 +89,7 @@ impl PrimaryKeyTrait for PrimaryKey { } #[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - AssetData, - AssetV1AccountAttachments, - AssetCreators, - AssetGrouping, - AssetAuthority, -} +pub enum Relation {} impl ColumnTrait for Column { type EntityName = Entity; @@ -124,54 +120,14 @@ impl ColumnTrait for Column { Self::SlotUpdated => ColumnType::BigInteger.def(), Self::DataHash => ColumnType::Char(Some(50u32)).def().null(), Self::CreatorHash => ColumnType::Char(Some(50u32)).def().null(), + Self::CompressedSeq => ColumnType::BigInteger.def().null(), } } } impl RelationTrait for Relation { fn def(&self) -> RelationDef { - match self { - Self::AssetData => Entity::belongs_to(super::asset_data::Entity) - .from(Column::AssetData) - .to(super::asset_data::Column::Id) - .into(), - Self::AssetV1AccountAttachments => { - Entity::has_many(super::asset_v1_account_attachments::Entity).into() - } - Self::AssetCreators => Entity::has_many(super::asset_creators::Entity).into(), - Self::AssetGrouping => Entity::has_many(super::asset_grouping::Entity).into(), - Self::AssetAuthority => Entity::has_many(super::asset_authority::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::AssetData.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::AssetV1AccountAttachments.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::AssetCreators.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::AssetGrouping.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::AssetAuthority.def() + panic!("No RelationDef") } } diff --git a/digital_asset_types/src/dao/generated/asset_authority.rs b/digital_asset_types/src/dao/generated/asset_authority.rs index 88d0ed72f..5ba29e6bd 100644 --- a/digital_asset_types/src/dao/generated/asset_authority.rs +++ b/digital_asset_types/src/dao/generated/asset_authority.rs @@ -45,9 +45,7 @@ impl PrimaryKeyTrait for PrimaryKey { } #[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Asset, -} +pub enum Relation {} impl ColumnTrait for Column { type EntityName = Entity; @@ -65,18 +63,7 @@ impl ColumnTrait for Column { impl RelationTrait for Relation { fn def(&self) -> RelationDef { - match self { - Self::Asset => Entity::belongs_to(super::asset::Entity) - .from(Column::AssetId) - .to(super::asset::Column::Id) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Asset.def() + panic!("No RelationDef") } } diff --git a/digital_asset_types/src/dao/generated/asset_creators.rs b/digital_asset_types/src/dao/generated/asset_creators.rs index 68de902d5..9d217919c 100644 --- a/digital_asset_types/src/dao/generated/asset_creators.rs +++ b/digital_asset_types/src/dao/generated/asset_creators.rs @@ -49,9 +49,7 @@ impl PrimaryKeyTrait for PrimaryKey { } #[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Asset, -} +pub enum Relation {} impl ColumnTrait for Column { type EntityName = Entity; @@ -71,18 +69,7 @@ impl ColumnTrait for Column { impl RelationTrait for Relation { fn def(&self) -> RelationDef { - match self { - Self::Asset => Entity::belongs_to(super::asset::Entity) - .from(Column::AssetId) - .to(super::asset::Column::Id) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Asset.def() + panic!("No RelationDef") } } diff --git a/digital_asset_types/src/dao/generated/asset_data.rs b/digital_asset_types/src/dao/generated/asset_data.rs index 5805a3829..a296c6c82 100644 --- a/digital_asset_types/src/dao/generated/asset_data.rs +++ b/digital_asset_types/src/dao/generated/asset_data.rs @@ -49,9 +49,7 @@ impl PrimaryKeyTrait for PrimaryKey { } #[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Asset, -} +pub enum Relation {} impl ColumnTrait for Column { type EntityName = Entity; @@ -70,15 +68,7 @@ impl ColumnTrait for Column { impl RelationTrait for Relation { fn def(&self) -> RelationDef { - match self { - Self::Asset => Entity::has_many(super::asset::Entity).into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Asset.def() + panic!("No RelationDef") } } diff --git a/digital_asset_types/src/dao/generated/asset_grouping.rs b/digital_asset_types/src/dao/generated/asset_grouping.rs index d0c547640..4f6ab6cda 100644 --- a/digital_asset_types/src/dao/generated/asset_grouping.rs +++ b/digital_asset_types/src/dao/generated/asset_grouping.rs @@ -45,9 +45,7 @@ impl PrimaryKeyTrait for PrimaryKey { } #[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Asset, -} +pub enum Relation {} impl ColumnTrait for Column { type EntityName = Entity; @@ -65,18 +63,7 @@ impl ColumnTrait for Column { impl RelationTrait for Relation { fn def(&self) -> RelationDef { - match self { - Self::Asset => Entity::belongs_to(super::asset::Entity) - .from(Column::AssetId) - .to(super::asset::Column::Id) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Asset.def() + panic!("No RelationDef") } } diff --git a/digital_asset_types/src/dao/generated/asset_v1_account_attachments.rs b/digital_asset_types/src/dao/generated/asset_v1_account_attachments.rs index f8b0ff21a..2d571b25e 100644 --- a/digital_asset_types/src/dao/generated/asset_v1_account_attachments.rs +++ b/digital_asset_types/src/dao/generated/asset_v1_account_attachments.rs @@ -46,9 +46,7 @@ impl PrimaryKeyTrait for PrimaryKey { } #[derive(Copy, Clone, Debug, EnumIter)] -pub enum Relation { - Asset, -} +pub enum Relation {} impl ColumnTrait for Column { type EntityName = Entity; @@ -66,18 +64,7 @@ impl ColumnTrait for Column { impl RelationTrait for Relation { fn def(&self) -> RelationDef { - match self { - Self::Asset => Entity::belongs_to(super::asset::Entity) - .from(Column::AssetId) - .to(super::asset::Column::Id) - .into(), - } - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Asset.def() + panic!("No RelationDef") } } diff --git a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs index 48fb34b5e..5774b4a98 100644 --- a/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs +++ b/digital_asset_types/src/dao/generated/sea_orm_active_enums.rs @@ -3,6 +3,62 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "specification_asset_class" +)] +pub enum SpecificationAssetClass { + #[sea_orm(string_value = "FUNGIBLE_ASSET")] + FungibleAsset, + #[sea_orm(string_value = "FUNGIBLE_TOKEN")] + FungibleToken, + #[sea_orm(string_value = "IDENTITY_NFT")] + IdentityNft, + #[sea_orm(string_value = "NFT")] + Nft, + #[sea_orm(string_value = "NON_TRANSFERABLE_NFT")] + NonTransferableNft, + #[sea_orm(string_value = "PRINT")] + Print, + #[sea_orm(string_value = "PRINTABLE_NFT")] + PrintableNft, + #[sea_orm(string_value = "TRANSFER_RESTRICTED_NFT")] + TransferRestrictedNft, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "v1_account_attachments" +)] +pub enum V1AccountAttachments { + #[sea_orm(string_value = "edition")] + Edition, + #[sea_orm(string_value = "edition_marker")] + EditionMarker, + #[sea_orm(string_value = "master_edition_v1")] + MasterEditionV1, + #[sea_orm(string_value = "master_edition_v2")] + MasterEditionV2, + #[sea_orm(string_value = "unknown")] + Unknown, +} +#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] +pub enum TaskStatus { + #[sea_orm(string_value = "failed")] + Failed, + #[sea_orm(string_value = "pending")] + Pending, + #[sea_orm(string_value = "running")] + Running, + #[sea_orm(string_value = "success")] + Success, +} #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm( rs_type = "String", @@ -36,18 +92,6 @@ pub enum RoyaltyTargetType { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "task_status")] -pub enum TaskStatus { - #[sea_orm(string_value = "failed")] - Failed, - #[sea_orm(string_value = "pending")] - Pending, - #[sea_orm(string_value = "running")] - Running, - #[sea_orm(string_value = "success")] - Success, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "chain_mutability")] pub enum ChainMutability { #[sea_orm(string_value = "immutable")] @@ -58,16 +102,6 @@ pub enum ChainMutability { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] -pub enum OwnerType { - #[sea_orm(string_value = "single")] - Single, - #[sea_orm(string_value = "token")] - Token, - #[sea_orm(string_value = "unknown")] - Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "mutability")] pub enum Mutability { #[sea_orm(string_value = "immutable")] @@ -78,48 +112,12 @@ pub enum Mutability { Unknown, } #[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "v1_account_attachments" -)] -pub enum V1AccountAttachments { - #[sea_orm(string_value = "edition")] - Edition, - #[sea_orm(string_value = "edition_marker")] - EditionMarker, - #[sea_orm(string_value = "master_edition_v1")] - MasterEditionV1, - #[sea_orm(string_value = "master_edition_v2")] - MasterEditionV2, - #[sea_orm(string_value = "unknown")] - Unknown, -} -#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "specification_asset_class" -)] -pub enum SpecificationAssetClass { - #[sea_orm(string_value = "FUNGIBLE_ASSET")] - FungibleAsset, - #[sea_orm(string_value = "FUNGIBLE_TOKEN")] - FungibleToken, - #[sea_orm(string_value = "IDENTITY_NFT")] - IdentityNft, - #[sea_orm(string_value = "NFT")] - Nft, - #[sea_orm(string_value = "NON_TRANSFERABLE_NFT")] - NonTransferableNft, - #[sea_orm(string_value = "PRINT")] - Print, - #[sea_orm(string_value = "PRINTABLE_NFT")] - PrintableNft, - #[sea_orm(string_value = "TRANSFER_RESTRICTED_NFT")] - TransferRestrictedNft, +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "owner_type")] +pub enum OwnerType { + #[sea_orm(string_value = "single")] + Single, + #[sea_orm(string_value = "token")] + Token, #[sea_orm(string_value = "unknown")] Unknown, - #[sea_orm(string_value = "PNFT")] - ProgrammableNft, }