@ronin/compiler 0.13.12 → 0.13.13
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/index.js +19 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1591,11 +1591,29 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query)
|
|
1591
1591
|
return [pluralType2, formatModelEntity(type, list)];
|
1592
1592
|
})
|
1593
1593
|
);
|
1594
|
+
models.push(modelWithPresets);
|
1594
1595
|
dependencyStatements.push({
|
1595
1596
|
statement: `CREATE TABLE "${modelWithPresets.table}" (${columns.join(", ")})`,
|
1596
1597
|
params: []
|
1597
1598
|
});
|
1598
|
-
|
1599
|
+
for (const [modelEntity, pluralModelEntity] of [
|
1600
|
+
["index", "indexes"],
|
1601
|
+
["trigger", "triggers"]
|
1602
|
+
]) {
|
1603
|
+
const entityValue = modelWithPresets[pluralModelEntity];
|
1604
|
+
if (!entityValue) continue;
|
1605
|
+
for (const item of entityValue) {
|
1606
|
+
const query2 = {
|
1607
|
+
alter: {
|
1608
|
+
model: modelWithPresets.slug,
|
1609
|
+
create: {
|
1610
|
+
[modelEntity]: item
|
1611
|
+
}
|
1612
|
+
}
|
1613
|
+
};
|
1614
|
+
transformMetaQuery(models, dependencyStatements, null, query2);
|
1615
|
+
}
|
1616
|
+
}
|
1599
1617
|
const modelWithObjects = Object.assign({}, modelWithPresets);
|
1600
1618
|
for (const entity2 in entities) {
|
1601
1619
|
if (!Object.hasOwn(entities, entity2)) continue;
|