@@ -86,8 +86,8 @@ export const SYSTEM_MODEL_CONTRACTS: readonly SystemModelContract[] = [
8686 color : { type : "string" } ,
8787 version : { type : "number" } ,
8888 columns : { relation : { kind : "many" , target : "FilterColumn" } } ,
89- createdAt : { type : "string " } ,
90- updatedAt : { type : "string " } ,
89+ createdAt : { type : "date " } ,
90+ updatedAt : { type : "date " } ,
9191 } ,
9292 } ,
9393 {
@@ -112,8 +112,8 @@ export const SYSTEM_MODEL_CONTRACTS: readonly SystemModelContract[] = [
112112 diff : { type : "json" } ,
113113 user : { relation : { kind : "one" , target : "User" } } ,
114114 isCurrent : { type : "boolean" } ,
115- createdAt : { type : "string " } ,
116- updatedAt : { type : "string " } ,
115+ createdAt : { type : "date " } ,
116+ updatedAt : { type : "date " } ,
117117 preview : { type : "boolean" } ,
118118 } ,
119119 } ,
@@ -127,8 +127,8 @@ export const SYSTEM_MODEL_CONTRACTS: readonly SystemModelContract[] = [
127127 notificationClass : { type : "string" } ,
128128 channel : { type : "string" } ,
129129 metadata : { type : "json" } ,
130- createdAt : { type : "string " } ,
131- updatedAt : { type : "string " } ,
130+ createdAt : { type : "date " } ,
131+ updatedAt : { type : "date " } ,
132132 } ,
133133 } ,
134134 {
@@ -161,7 +161,12 @@ export function validateSystemModelContract(
161161 continue ;
162162 }
163163
164- if ( expected . type && actual . type !== expected . type ) {
164+ // Before `date` existed, temporal columns were reported as `string`.
165+ // Keep accepting that from third-party adapters that have not been updated.
166+ const typeMatches = expected . type === actual . type
167+ || ( expected . type === "date" && actual . type === "string" ) ;
168+
169+ if ( expected . type && ! typeMatches ) {
165170 errors . push ( `attribute "${ attributeName } " must have type "${ expected . type } ", received "${ actual . type } "` ) ;
166171 }
167172 if ( expected . required === true && actual . required !== true ) {
0 commit comments