-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,267 additions
and
652 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
use sea_schema::migration::prelude::*; | ||
|
||
use entity::projected_nft::*; | ||
|
||
pub struct Migration; | ||
|
||
impl MigrationName for Migration { | ||
fn name(&self) -> &str { | ||
"m20231025_000016_projected_nft" | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.create_table( | ||
Table::create() | ||
.table(Entity) | ||
.if_not_exists() | ||
.col( | ||
ColumnDef::new(Column::Id) | ||
.big_integer() | ||
.not_null() | ||
.auto_increment(), | ||
) | ||
.col(ColumnDef::new(Column::UtxoId).big_integer()) | ||
.col(ColumnDef::new(Column::TxId).big_integer().not_null()) | ||
.col(ColumnDef::new(Column::Asset).text().not_null()) | ||
.col(ColumnDef::new(Column::Amount).big_integer().not_null()) | ||
.col(ColumnDef::new(Column::Operation).integer()) | ||
.col(ColumnDef::new(Column::PlutusDatum).binary()) | ||
.foreign_key( | ||
ForeignKey::create() | ||
.name("fk-projected_nft-tx_id") | ||
.from(Entity, Column::TxId) | ||
.to( | ||
entity::prelude::Transaction, | ||
entity::prelude::TransactionColumn::Id, | ||
) | ||
.on_delete(ForeignKeyAction::Cascade), | ||
) | ||
.foreign_key( | ||
ForeignKey::create() | ||
.name("fk-projected_nft-utxo_id") | ||
.from(Entity, Column::UtxoId) | ||
.to( | ||
entity::prelude::TransactionOutput, | ||
entity::prelude::TransactionOutputColumn::Id, | ||
) | ||
.on_delete(ForeignKeyAction::Cascade), | ||
) | ||
.primary_key( | ||
Index::create() | ||
.table(Entity) | ||
.name("projected_nft-pk") | ||
.col(Column::Id), | ||
) | ||
.to_owned(), | ||
) | ||
.await | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.drop_table(Table::drop().table(Entity).to_owned()) | ||
.await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#[allow(non_snake_case)] | ||
pub mod AddressConfig; | ||
#[allow(non_snake_case)] | ||
pub mod EmptyConfig; | ||
#[allow(non_snake_case)] | ||
pub mod PayloadAndReadonlyConfig; | ||
#[allow(non_snake_case)] | ||
pub mod PayloadConfig; | ||
#[allow(non_snake_case)] | ||
pub mod ReadonlyConfig; | ||
#[allow(non_snake_case)] | ||
pub mod AddressConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.