-
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
f66566a
commit bf1818a
Showing
4 changed files
with
75 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: 'The Crane Soars Skyward', | ||
start: '2024-01-31 06:00:00', | ||
end: '2024-02-20 17:59:00', | ||
id: 300060, | ||
}, | ||
weapons: { | ||
name: 'Epitome Invocation', | ||
start: '2024-01-31 06:00:00', | ||
end: '2024-02-20 17:59:00', | ||
id: 400059, | ||
}, | ||
}; | ||
|
||
export class UpdateBanner1706674843762 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, [300060, 400059]); | ||
} | ||
} |
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