@aws-amplify/data-schema 1.25.1 → 1.25.2
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.
|
@@ -1184,13 +1184,19 @@ const schemaPreprocessor = (schema) => {
|
|
|
1184
1184
|
const refersToString = typeDef.data.originalName
|
|
1185
1185
|
? ` @refersTo(name: "${typeDef.data.originalName}")`
|
|
1186
1186
|
: '';
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1187
|
+
const disabledAttrs = modelAttributesFromDisabledOps(typeDef.data.disabledOperations);
|
|
1188
|
+
const modelAttrs = disabledAttrs
|
|
1189
|
+
? `timestamps: null, ${disabledAttrs}`
|
|
1190
|
+
: 'timestamps: null';
|
|
1191
|
+
/*
|
|
1192
|
+
* TODO: update @model(timestamps: null) once a longer term solution gets
|
|
1193
|
+
* determined.
|
|
1194
|
+
*
|
|
1195
|
+
* Context: SQL schema should not be automatically inserted with timestamp
|
|
1196
|
+
* fields, passing (timestamps: null) to @model to suppress this behavior
|
|
1197
|
+
* as a short term solution.
|
|
1198
|
+
*/
|
|
1199
|
+
const model = `type ${typeName} @model(${modelAttrs}) ${authString}${refersToString}\n{\n ${joined}\n}`;
|
|
1194
1200
|
gqlModels.push(model);
|
|
1195
1201
|
}
|
|
1196
1202
|
else {
|