-
Notifications
You must be signed in to change notification settings - Fork 28
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
1 parent
35c69cf
commit bb38cff
Showing
4 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
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,43 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
import { Banner } from '../entities/banner'; | ||
|
||
const banners = { | ||
characters: { | ||
name: 'Seeker of Flame-Wrought Secrets', | ||
start: '2024-09-17 18:00:00', | ||
end: '2024-10-08 14:59:00', | ||
id: 300071, | ||
}, | ||
weapons: { | ||
name: 'Epitome Invocation', | ||
start: '2024-09-17 18:00:00', | ||
end: '2024-10-08 14:59:00', | ||
id: 400070, | ||
}, | ||
}; | ||
|
||
export class UpdateBanner1726588161035 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const newCharacterBanner = banners.characters; | ||
const characterBanner = new Banner(); | ||
characterBanner.id = newCharacterBanner.id; | ||
characterBanner.type = 'characters'; | ||
characterBanner.name = newCharacterBanner.name; | ||
characterBanner.start = `${newCharacterBanner.start}+8`; | ||
characterBanner.end = `${newCharacterBanner.end}+8`; | ||
|
||
const newWeaponBanner = banners.weapons; | ||
const weaponBanner = new Banner(); | ||
weaponBanner.id = newWeaponBanner.id; | ||
weaponBanner.type = 'weapons'; | ||
weaponBanner.name = newWeaponBanner.name; | ||
weaponBanner.start = `${newWeaponBanner.start}+8`; | ||
weaponBanner.end = `${newWeaponBanner.end}+8`; | ||
|
||
await queryRunner.manager.save([characterBanner, weaponBanner]); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.manager.delete(Banner, [300071, 400070]); | ||
} | ||
} |
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