@aws-amplify/data-schema 1.25.1 → 1.25.3

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
- // 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 fields,
1191
- // passing (timestamps: null) to @model to suppress this behavior as a short
1192
- // term solution.
1193
- const model = `type ${typeName} @model(timestamps: null) ${authString}${refersToString}\n{\n ${joined}\n}`;
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 {