Skip to content

Commit

Permalink
Add compressed_seq for compression related asset fields
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed May 26, 2023
1 parent bee5977 commit 6285923
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 185 deletions.
54 changes: 5 additions & 49 deletions digital_asset_types/src/dao/generated/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct Model {
pub slot_updated: i64,
pub data_hash: Option<String>,
pub creator_hash: Option<String>,
pub compressed_seq: Option<i64>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
Expand Down Expand Up @@ -72,6 +73,7 @@ pub enum Column {
SlotUpdated,
DataHash,
CreatorHash,
CompressedSeq,
}

#[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
Expand All @@ -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;
Expand Down Expand Up @@ -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<super::asset_data::Entity> for Entity {
fn to() -> RelationDef {
Relation::AssetData.def()
}
}

impl Related<super::asset_v1_account_attachments::Entity> for Entity {
fn to() -> RelationDef {
Relation::AssetV1AccountAttachments.def()
}
}

impl Related<super::asset_creators::Entity> for Entity {
fn to() -> RelationDef {
Relation::AssetCreators.def()
}
}

impl Related<super::asset_grouping::Entity> for Entity {
fn to() -> RelationDef {
Relation::AssetGrouping.def()
}
}

impl Related<super::asset_authority::Entity> for Entity {
fn to() -> RelationDef {
Relation::AssetAuthority.def()
panic!("No RelationDef")
}
}

Expand Down
17 changes: 2 additions & 15 deletions digital_asset_types/src/dao/generated/asset_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<super::asset::Entity> for Entity {
fn to() -> RelationDef {
Relation::Asset.def()
panic!("No RelationDef")
}
}

Expand Down
17 changes: 2 additions & 15 deletions digital_asset_types/src/dao/generated/asset_creators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<super::asset::Entity> for Entity {
fn to() -> RelationDef {
Relation::Asset.def()
panic!("No RelationDef")
}
}

Expand Down
14 changes: 2 additions & 12 deletions digital_asset_types/src/dao/generated/asset_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<super::asset::Entity> for Entity {
fn to() -> RelationDef {
Relation::Asset.def()
panic!("No RelationDef")
}
}

Expand Down
17 changes: 2 additions & 15 deletions digital_asset_types/src/dao/generated/asset_grouping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<super::asset::Entity> for Entity {
fn to() -> RelationDef {
Relation::Asset.def()
panic!("No RelationDef")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<super::asset::Entity> for Entity {
fn to() -> RelationDef {
Relation::Asset.def()
panic!("No RelationDef")
}
}

Expand Down
126 changes: 62 additions & 64 deletions digital_asset_types/src/dao/generated/sea_orm_active_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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")]
Expand All @@ -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")]
Expand All @@ -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,
}

0 comments on commit 6285923

Please sign in to comment.