-
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
85c102d
commit f51fffa
Showing
4 changed files
with
73 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: "Piercing Shot's Crimson Wake", | ||
start: '2024-12-10 18:00:00', | ||
end: '2024-12-31 14:59:00', | ||
id: 300075, | ||
}, | ||
weapons: { | ||
name: 'Epitome Invocation', | ||
start: '2024-12-10 18:00:00', | ||
end: '2024-12-31 14:59:00', | ||
id: 400074, | ||
}, | ||
}; | ||
|
||
export class UpdateBanner1733815438034 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, [300074, 400073]); | ||
} | ||
} |
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