Skip to content

Commit

Permalink
only add sepolia token on development env
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadPCh committed Aug 21, 2024
1 parent d63954f commit 24a9640
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions migration/1724166731604-addSepoliaToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import { MigrationInterface, QueryRunner } from 'typeorm';
import { Token } from '../src/entities/token';
import { NETWORK_IDS } from '../src/provider';
import seedTokens from './data/seedTokens';
import config from '../src/config';

export class AddSepoliaToken1724166731604 implements MigrationInterface {
async up(queryRunner: QueryRunner): Promise<void> {
const environment = config.get('ENVIRONMENT') as string;
// We don't add sepolia tokens in production ENV
if (environment === 'production') return;

await queryRunner.manager.save(
Token,
seedTokens
Expand Down Expand Up @@ -43,6 +48,9 @@ export class AddSepoliaToken1724166731604 implements MigrationInterface {
}

async down(queryRunner: QueryRunner): Promise<void> {
const environment = config.get('ENVIRONMENT') as string;
// We don't add sepolia tokens in production ENV
if (environment === 'production') return;
await queryRunner.query(`
DELETE FROM organization_tokens_token
WHERE "tokenId" IN (
Expand Down

0 comments on commit 24a9640

Please sign in to comment.