@astrojs/db 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,7 +18,7 @@ async function cmd({
|
|
|
18
18
|
const appToken = await getManagedAppTokenOrExit(flags.token);
|
|
19
19
|
const productionSnapshot = await getProductionCurrentSnapshot({ appToken: appToken.token });
|
|
20
20
|
const currentSnapshot = createCurrentSnapshot(dbConfig);
|
|
21
|
-
const isFromScratch = isForceReset ||
|
|
21
|
+
const isFromScratch = isForceReset || !productionSnapshot;
|
|
22
22
|
const { queries: migrationQueries, confirmations } = await getMigrationQueries({
|
|
23
23
|
oldSnapshot: isFromScratch ? createEmptySnapshot() : productionSnapshot,
|
|
24
24
|
newSnapshot: currentSnapshot
|
|
@@ -15,7 +15,7 @@ async function cmd({
|
|
|
15
15
|
const productionSnapshot = await getProductionCurrentSnapshot({ appToken: appToken.token });
|
|
16
16
|
const currentSnapshot = createCurrentSnapshot(dbConfig);
|
|
17
17
|
const { queries: migrationQueries, confirmations } = await getMigrationQueries({
|
|
18
|
-
oldSnapshot:
|
|
18
|
+
oldSnapshot: productionSnapshot || createEmptySnapshot(),
|
|
19
19
|
newSnapshot: currentSnapshot
|
|
20
20
|
});
|
|
21
21
|
const result = { exitCode: 0, message: "", code: "", data: void 0 };
|
|
@@ -16,7 +16,7 @@ export declare function getCollectionChangeQueries({ collectionName, oldCollecti
|
|
|
16
16
|
}>;
|
|
17
17
|
export declare function getProductionCurrentSnapshot({ appToken, }: {
|
|
18
18
|
appToken: string;
|
|
19
|
-
}): Promise<DBSnapshot>;
|
|
19
|
+
}): Promise<DBSnapshot | undefined>;
|
|
20
20
|
export declare function createCurrentSnapshot({ tables }: DBConfig): DBSnapshot;
|
|
21
21
|
export declare function createEmptySnapshot(): DBSnapshot;
|
|
22
22
|
export declare function formatDataLossMessage(confirmations: string[], isColor?: boolean): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/db",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"mocha": "^10.2.0",
|
|
78
78
|
"typescript": "^5.2.2",
|
|
79
79
|
"vite": "^5.1.4",
|
|
80
|
-
"astro": "4.
|
|
80
|
+
"astro": "4.5.0",
|
|
81
81
|
"astro-scripts": "0.0.14"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|