Skip to content

Commit

Permalink
Rename royalty_amount_seq to base_info_seq
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed Dec 4, 2023
1 parent 933e299 commit 8732ba9
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 65 deletions.
6 changes: 3 additions & 3 deletions digital_asset_types/src/dao/generated/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct Model {
pub owner_delegate_seq: Option<i64>,
pub was_decompressed: bool,
pub leaf_seq: Option<i64>,
pub royalty_amount_seq: Option<i64>,
pub base_info_seq: Option<i64>,
pub creators_added_seq: Option<i64>,
}

Expand Down Expand Up @@ -80,7 +80,7 @@ pub enum Column {
OwnerDelegateSeq,
WasDecompressed,
LeafSeq,
RoyaltyAmountSeq,
BaseInfoSeq,
CreatorsAddedSeq,
}

Expand Down Expand Up @@ -137,7 +137,7 @@ impl ColumnTrait for Column {
Self::OwnerDelegateSeq => ColumnType::BigInteger.def().null(),
Self::WasDecompressed => ColumnType::Boolean.def(),
Self::LeafSeq => ColumnType::BigInteger.def().null(),
Self::RoyaltyAmountSeq => ColumnType::BigInteger.def().null(),
Self::BaseInfoSeq => ColumnType::BigInteger.def().null(),
Self::CreatorsAddedSeq => ColumnType::BigInteger.def().null(),
}
}
Expand Down
112 changes: 56 additions & 56 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,41 +3,19 @@
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 = "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 = "specification_asset_class"
enum_name = "royalty_target_type"
)]
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 = "PROGRAMMABLE_NFT")]
ProgrammableNft,
#[sea_orm(string_value = "TRANSFER_RESTRICTED_NFT")]
TransferRestrictedNft,
pub enum RoyaltyTargetType {
#[sea_orm(string_value = "creators")]
Creators,
#[sea_orm(string_value = "fanout")]
Fanout,
#[sea_orm(string_value = "single")]
Single,
#[sea_orm(string_value = "unknown")]
Unknown,
}
Expand All @@ -60,6 +38,18 @@ pub enum V1AccountAttachments {
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",
Expand All @@ -76,34 +66,44 @@ pub enum SpecificationVersions {
V2,
}
#[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")]
Immutable,
#[sea_orm(string_value = "mutable")]
Mutable,
#[sea_orm(string_value = "unknown")]
Unknown,
}
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "royalty_target_type"
enum_name = "specification_asset_class"
)]
pub enum RoyaltyTargetType {
#[sea_orm(string_value = "creators")]
Creators,
#[sea_orm(string_value = "fanout")]
Fanout,
#[sea_orm(string_value = "single")]
Single,
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 = "PROGRAMMABLE_NFT")]
ProgrammableNft,
#[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 = "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 @@ -114,12 +114,12 @@ pub enum ChainMutability {
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")]
Immutable,
#[sea_orm(string_value = "mutable")]
Mutable,
#[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,
}
2 changes: 1 addition & 1 deletion digital_asset_types/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub fn create_asset(
owner_delegate_seq: Some(0),
was_decompressed: false,
leaf_seq: Some(0),
royalty_amount_seq: Some(0),
base_info_seq: Some(0),
creators_added_seq: Some(0),
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(asset::Entity)
.add_column(ColumnDef::new(Alias::new("royalty_amount_seq")).big_integer())
.add_column(ColumnDef::new(Alias::new("base_info_seq")).big_integer())
.add_column(ColumnDef::new(Alias::new("creators_added_seq")).big_integer())
.to_owned(),
)
Expand Down Expand Up @@ -72,7 +72,7 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(asset::Entity)
.drop_column(Alias::new("royalty_amount_seq"))
.drop_column(Alias::new("base_info_seq"))
.drop_column(Alias::new("creators_added_seq"))
.to_owned(),
)
Expand Down
6 changes: 3 additions & 3 deletions nft_ingester/src/program_transformers/bubblegum/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ where
royalty_amount: Set(royalty_amount),
asset_data: Set(Some(id)),
slot_updated: Set(Some(slot_updated)),
//royalty_amount_seq: Set(Some(seq)),
base_info_seq: Set(Some(seq)),
..Default::default()
};

Expand All @@ -741,7 +741,7 @@ where
asset::Column::RoyaltyAmount,
asset::Column::AssetData,
asset::Column::SlotUpdated,
asset::Column::RoyaltyAmountSeq,
asset::Column::BaseInfoSeq,
])
.to_owned(),
)
Expand All @@ -750,7 +750,7 @@ where
// Do not overwrite changes that happened after decompression (asset.seq = 0).
// Do not overwrite changes from a later Bubblegum instruction.
query.sql = format!(
"{} WHERE asset.seq != 0 AND (excluded.royalty_amount_seq >= asset.royalty_amount_seq OR royalty_amount_seq.seq IS NULL)",
"{} WHERE asset.seq != 0 AND (excluded.base_info_seq >= asset.base_info_seq OR asset.base_info_seq IS NULL)",
query.sql
);

Expand Down

0 comments on commit 8732ba9

Please sign in to comment.