@@ -29,20 +29,19 @@ export default class DasStand extends BaseModel {
2929 } )
3030 declare das : BelongsTo < typeof Das > ;
3131
32- @typedColumn ( { type : "string" } )
32+ @typedColumn ( { type : "string" , validator : vine . string ( ) . maxLength ( 127 ) } )
3333 declare name : string ;
3434
3535 @typedColumn ( {
3636 type : "string" ,
3737 optional : true ,
38- validator : vine . string ( ) . maxLength ( 7 ) ,
38+ validator : vine . string ( ) . maxLength ( 7 ) . optional ( ) . nullable ( ) ,
3939 } )
4040 declare floor : string | null ; // Also knowing PWr, floor number could also not be a number
4141
4242 @typedColumn ( {
4343 type : "string" ,
4444 optional : true ,
45- validator : vine . string ( ) . maxLength ( 15 ) ,
4645 } )
4746 declare description : string | null ;
4847
@@ -53,27 +52,27 @@ export default class DasStand extends BaseModel {
5352 } )
5453 declare studentOrganizationId : number | null ;
5554
55+ @typedColumn ( { foreignKeyOf : ( ) => FileEntry , optional : true } )
56+ declare logoKey : string | null ;
57+
58+ @typedColumn . dateTime ( { autoCreate : true } )
59+ declare createdAt : DateTime ;
60+
61+ @typedColumn . dateTime ( { autoCreate : true , autoUpdate : true } )
62+ declare updatedAt : DateTime ;
63+
5664 @belongsTo ( ( ) => StudentOrganization , {
5765 localKey : "id" ,
5866 foreignKey : "studentOrganizationId" ,
5967 } )
6068 declare studentOrganization : BelongsTo < typeof StudentOrganization > ;
6169
62- @typedColumn ( { foreignKeyOf : ( ) => FileEntry , optional : true } )
63- declare logoKey : string | null ;
64-
6570 @belongsTo ( ( ) => FileEntry , {
6671 localKey : "id" ,
6772 foreignKey : "logoKey" ,
6873 } )
6974 declare logo : BelongsTo < typeof FileEntry > ;
7075
71- @typedColumn . dateTime ( { autoCreate : true } )
72- declare createdAt : DateTime ;
73-
74- @typedColumn . dateTime ( { autoCreate : true , autoUpdate : true } )
75- declare updatedAt : DateTime ;
76-
7776 static preloadRelations = preloadRelations ( ) ;
7877 static handleSearchQuery = handleSearchQuery ( ) ;
7978 static handleSortQuery = handleSortQuery ( ) ;
0 commit comments