@apso/cli 0.47.3 → 0.47.4
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/lib/ddl/index.js +18 -7
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/lib/ddl/index.js
CHANGED
|
@@ -160,13 +160,24 @@ function schemaModel(input) {
|
|
|
160
160
|
const joinTables = [];
|
|
161
161
|
const inline = [];
|
|
162
162
|
const foreignKeys = [];
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
columns,
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
// The same columns can be indexed twice (a field or relationship
|
|
164
|
+
// "index": true plus an "indexes" entry). TypeORM names an index by its
|
|
165
|
+
// table and columns, so a second CREATE INDEX would fail on deploy: keep one.
|
|
166
|
+
const index = (table, columns, unique = false) => {
|
|
167
|
+
const key = `index:${table}(${columns.join(",")})`;
|
|
168
|
+
const seen = model.indexes.find((i) => i.key === key);
|
|
169
|
+
if (seen) {
|
|
170
|
+
seen.unique || (seen.unique = unique);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
model.indexes.push({
|
|
174
|
+
key,
|
|
175
|
+
name: exports.constraintName.index(table, columns),
|
|
176
|
+
table,
|
|
177
|
+
columns,
|
|
178
|
+
unique,
|
|
179
|
+
});
|
|
180
|
+
};
|
|
170
181
|
const unique = (table, columns, name, list = inline) => list.push({
|
|
171
182
|
key: `unique:${table}(${columns.join(",")})`,
|
|
172
183
|
name,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apso/cli",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@apso/cli",
|
|
9
|
-
"version": "0.47.
|
|
9
|
+
"version": "0.47.4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apso/schema-tools": "^0.2.0",
|
package/oclif.manifest.json
CHANGED