-
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
3d8f73a
commit f66566a
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: 'Reign of Serenity', | ||
start: '2024-01-09 18:00:00', | ||
end: '2024-01-30 14:59:00', | ||
id: 300059, | ||
}, | ||
weapons: { | ||
name: 'Epitome Invocation', | ||
start: '2024-01-09 18:00:00', | ||
end: '2024-01-30 14:59:00', | ||
id: 400058, | ||
}, | ||
}; | ||
|
||
export class UpdateBanner1704801826442 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, [300059, 400058]); | ||
} | ||
} |
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