We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9f62b87 + f2d21ec commit feb8042Copy full SHA for feb8042
firebase/migrations/v0.0.9__fix_advantage_system.ts
@@ -0,0 +1,20 @@
1
+export async function migrate({firestore}: { firestore: firebase.firestore.Firestore }): Promise<void> {
2
+ const parties = await firestore.collection("parties").get();
3
+
4
+ for (const document of parties.docs) {
5
+ const data = document.data();
6
7
+ if (data.settings.advantageSystem == "INITIATIVE_CHARACTERISTIC") {
8
+ await document.ref.set(
9
+ {
10
+ settings: {
11
+ initiativeStrategy: data.settings.initiativeStrategy,
12
+ advantageSystem: "CORE_RULEBOOK",
13
+ advantageCap: data.settings.advantageCap
14
+ }
15
+ },
16
+ {merge: true},
17
+ );
18
19
20
+}
0 commit comments