-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [#188172536] add owningUser to v151 migration
- Loading branch information
1 parent
3ce7d6d
commit 6e955a1
Showing
4 changed files
with
21 additions
and
7 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
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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { generatev150UserData } from "@db/migrations/v150_remove_needs_nexus_dba_name"; | ||
import { migrate_v150_to_v151 } from "@db/migrations/v151_extract_business_data"; | ||
|
||
describe("v151 migration adds version field to businesses object", () => { | ||
it("should upgrade v150 user by adding version field to businesses object", () => { | ||
describe("v151 migration adds version field and userId to businesses object", () => { | ||
it("should upgrade v150 user by adding version field and userId field to businesses object", () => { | ||
const v150UserData = generatev150UserData({}); | ||
|
||
const migratedUserData = migrate_v150_to_v151(v150UserData); | ||
expect(migratedUserData.version).toBe(151); | ||
for (const business of Object.values(migratedUserData.businesses)) { | ||
expect(business.version).toBe(151); | ||
|
||
expect(business.userId).toBeDefined(); | ||
expect(typeof business.userId).toBe("string"); | ||
} | ||
}); | ||
}); |
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