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.
@@ -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
- ...Object.keys(meta.indexes)
102
+ ...schemaIndexes.keys()
100
103
  ]);
101
104
  for (const indexName of indexNames) {
102
105
  const localInstruction = local.indexes[indexName];
103
- const schemaIndex = meta.indexes[indexName];
106
+ const schemaIndex = schemaIndexes.get(indexName);
104
107
  if (!localInstruction) {
105
- res.push(new QueryData.CreateIndex({ table: schema2, index: schemaIndex }));
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",