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