rado 0.3.0 → 0.3.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.
- package/dist/define/Schema.js +8 -3
- package/package.json +1 -1
package/dist/define/Schema.js
CHANGED
|
@@ -94,15 +94,20 @@ var Schema;
|
|
|
94
94
|
return recreateTable(schema2, new Set(added));
|
|
95
95
|
}
|
|
96
96
|
const meta = schema2.meta();
|
|
97
|
+
const schemaIndexes = new Map(
|
|
98
|
+
Object.values(meta.indexes).map((index) => [index.name, index])
|
|
99
|
+
);
|
|
97
100
|
const indexNames = /* @__PURE__ */ new Set([
|
|
98
101
|
...Object.keys(local.indexes),
|
|
99
|
-
...
|
|
102
|
+
...schemaIndexes.keys()
|
|
100
103
|
]);
|
|
101
104
|
for (const indexName of indexNames) {
|
|
102
105
|
const localInstruction = local.indexes[indexName];
|
|
103
|
-
const schemaIndex =
|
|
106
|
+
const schemaIndex = schemaIndexes.get(indexName);
|
|
104
107
|
if (!localInstruction) {
|
|
105
|
-
res.push(
|
|
108
|
+
res.push(
|
|
109
|
+
new QueryData.CreateIndex({ table: schema2, index: schemaIndex })
|
|
110
|
+
);
|
|
106
111
|
if (verbose)
|
|
107
112
|
console.log(`Adding index ${indexName}`);
|
|
108
113
|
} else if (!schemaIndex) {
|