fix | just add test case. Worked already with recent fixes.
@@ -112,3 +112,21 @@ fn must_error_if_now_function_is_used_for_fields_that_are_not_datetime() {
Span::new(70, 75),
));
}
+
+#[test]
+fn must_error_if_autoincrement_function_is_used_for_fields_that_are_not_int() {
+ let dml = r#"
+ model Model {
+ id Int @id
+ foo String @default(autoincrement())
+ }
+ "#;
+
+ let errors = parse_error(dml);
+
+ errors.assert_is(DatamodelError::new_directive_validation_error(
+ "The function `autoincrement()` can not be used on fields of type `String`.",
+ "default",
+ Span::new(70, 85),
+ ));
+}
