Skip to content

Commit

Permalink
Merge pull request #272 from holaplex/main
Browse files Browse the repository at this point in the history
Release 10/22
  • Loading branch information
kespinola authored Oct 22, 2023
2 parents 3e4ab2c + 8458dac commit d4cc31f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 64 deletions.
1 change: 0 additions & 1 deletion api/src/entities/collection_mints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub struct Model {
pub credits_deduction_id: Option<Uuid>,
#[sea_orm(nullable)]
pub compressed: Option<bool>,
pub random_pick: i64,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
1 change: 0 additions & 1 deletion api/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ impl Processor {
.map_err(ProcessorErrorKind::InvalidSellerFee)?),
credits_deduction_id: Set(None),
compressed: Set(Some(compressed)),
..Default::default()
};

let mint_model = mint_am.insert(self.db.get()).await?;
Expand Down
10 changes: 7 additions & 3 deletions api/src/mutations/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ use hub_core::{
producer::Producer,
};
use redis::AsyncCommands;
use sea_orm::{prelude::*, JoinType, Order, QueryOrder, QuerySelect, Set, TransactionTrait};
use sea_orm::{
prelude::*,
sea_query::{Func, SimpleExpr},
JoinType, Order, QueryOrder, QuerySelect, Set, TransactionTrait,
};

use super::collection::{
fetch_owner, validate_creators, validate_json, validate_solana_creator_verification,
Expand Down Expand Up @@ -1172,7 +1176,7 @@ impl Mutation {
let mint = CollectionMints::find()
.filter(collection_mints::Column::CollectionId.eq(drop.collection_id))
.filter(collection_mints::Column::CreationStatus.eq(CreationStatus::Queued))
.order_by(collection_mints::Column::RandomPick, Order::Asc)
.order_by(SimpleExpr::FunctionCall(Func::random()), Order::Asc)
.one(conn)
.await?
.ok_or(Error::new("No Queued mint found for the drop"))?;
Expand Down Expand Up @@ -1351,7 +1355,7 @@ impl Mutation {
)
.filter(collection_mints::Column::CollectionId.eq(drop.collection_id))
.filter(collection_mints::Column::CreationStatus.eq(CreationStatus::Queued))
.order_by(collection_mints::Column::RandomPick, Order::Asc)
.order_by(SimpleExpr::FunctionCall(Func::random()), Order::Asc)
.limit(Some(batch_size.try_into()?))
.all(conn)
.await?;
Expand Down
1 change: 0 additions & 1 deletion api/src/objects/collection_mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ impl From<Model> for CollectionMint {
seller_fee_basis_points,
credits_deduction_id,
compressed,
..
}: Model,
) -> Self {
Self {
Expand Down
4 changes: 1 addition & 3 deletions migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ mod m20230914_154759_add_job_trackings_table;
mod m20230915_111128_create_mints_creation_status_idx;
mod m20230922_150621_nullable_metadata_jsons_identifier_and_uri;
mod m20231011_202917_create_queued_mints_idx;
mod m20231020_123046_add_random_pick_to_collection_mints;

pub struct Migrator;

Expand Down Expand Up @@ -126,11 +125,10 @@ impl MigratorTrait for Migrator {
Box::new(m20230910_204731_add_queued_variant_to_mints_status::Migration),
Box::new(m20230910_212742_make_owner_address_optional_for_mint::Migration),
Box::new(m20230911_144938_make_compressed_column_optional::Migration),
Box::new(m20230914_154759_add_job_trackings_table::Migration),
Box::new(m20230915_111128_create_mints_creation_status_idx::Migration),
Box::new(m20230914_154759_add_job_trackings_table::Migration),
Box::new(m20230922_150621_nullable_metadata_jsons_identifier_and_uri::Migration),
Box::new(m20231011_202917_create_queued_mints_idx::Migration),
Box::new(m20231020_123046_add_random_pick_to_collection_mints::Migration),
]
}
}

This file was deleted.

0 comments on commit d4cc31f

Please sign in to comment.