-
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
54518f5
commit 0956413
Showing
4 changed files
with
69 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: 'In the Name of the Rosula', | ||
start: '2024-06-05 06:00:00', | ||
end: '2024-06-25 17:59:00', | ||
id: 300068, | ||
}, | ||
weapons: { | ||
name: 'Epitome Invocation', | ||
start: '2024-06-05 06:00:00', | ||
end: '2024-06-25 17:59:00', | ||
id: 400067, | ||
}, | ||
}; | ||
|
||
export class UpdateBanner1721200362432 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, [300068, 400067]); | ||
} | ||
} |
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