@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.
package/package.json
CHANGED
package/src/SchemaProcessor.ts
CHANGED
|
@@ -1821,13 +1821,23 @@ const schemaPreprocessor = (
|
|
|
1821
1821
|
const refersToString = typeDef.data.originalName
|
|
1822
1822
|
? ` @refersTo(name: "${typeDef.data.originalName}")`
|
|
1823
1823
|
: '';
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1824
|
+
|
|
1825
|
+
const disabledAttrs = modelAttributesFromDisabledOps(
|
|
1826
|
+
typeDef.data.disabledOperations,
|
|
1827
|
+
);
|
|
1828
|
+
const modelAttrs = disabledAttrs
|
|
1829
|
+
? `timestamps: null, ${disabledAttrs}`
|
|
1830
|
+
: 'timestamps: null';
|
|
1831
|
+
|
|
1832
|
+
/*
|
|
1833
|
+
* TODO: update @model(timestamps: null) once a longer term solution gets
|
|
1834
|
+
* determined.
|
|
1835
|
+
*
|
|
1836
|
+
* Context: SQL schema should not be automatically inserted with timestamp
|
|
1837
|
+
* fields, passing (timestamps: null) to @model to suppress this behavior
|
|
1838
|
+
* as a short term solution.
|
|
1839
|
+
*/
|
|
1840
|
+
const model = `type ${typeName} @model(${modelAttrs}) ${authString}${refersToString}\n{\n ${joined}\n}`;
|
|
1831
1841
|
gqlModels.push(model);
|
|
1832
1842
|
} else {
|
|
1833
1843
|
const fields = typeDef.data.fields as Record<string, BaseModelField>;
|