-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'helius/helius' into espi/token-extensio…
…ns-upstream
- Loading branch information
Showing
18 changed files
with
880 additions
and
174 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
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,59 @@ | ||
use sea_orm_migration::{ | ||
prelude::*, | ||
sea_orm::{ConnectionTrait, DatabaseBackend, Statement}, | ||
}; | ||
|
||
#[derive(DeriveMigrationName)] | ||
pub struct Migration; | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
let connection = manager.get_connection(); | ||
|
||
connection | ||
.execute(Statement::from_string( | ||
DatabaseBackend::Postgres, | ||
"ALTER TABLE asset ADD COLUMN mint_extensions jsonb;".to_string(), | ||
)) | ||
.await?; | ||
connection | ||
.execute(Statement::from_string( | ||
DatabaseBackend::Postgres, | ||
"ALTER TABLE tokens ADD COLUMN extensions jsonb;".to_string(), | ||
)) | ||
.await?; | ||
connection | ||
.execute(Statement::from_string( | ||
DatabaseBackend::Postgres, | ||
"ALTER TABLE token_accounts ADD COLUMN extensions jsonb;".to_string(), | ||
)) | ||
.await?; | ||
Ok(()) | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
let connection = manager.get_connection(); | ||
|
||
connection | ||
.execute(Statement::from_string( | ||
DatabaseBackend::Postgres, | ||
"ALTER TABLE asset DROP COLUMN mint_extensions;".to_string(), | ||
)) | ||
.await?; | ||
connection | ||
.execute(Statement::from_string( | ||
DatabaseBackend::Postgres, | ||
"ALTER TABLE tokens DROP COLUMN extensions;".to_string(), | ||
)) | ||
.await?; | ||
connection | ||
.execute(Statement::from_string( | ||
DatabaseBackend::Postgres, | ||
"ALTER TABLE token_accounts DROP COLUMN extensions;".to_string(), | ||
)) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
} |
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.