File tree Expand file tree Collapse file tree 4 files changed +25
-18
lines changed
migrations/20250730152040_add_description_column Expand file tree Collapse file tree 4 files changed +25
-18
lines changed Original file line number Diff line number Diff line change 1+ -- AlterTable
2+ ALTER TABLE " User" ADD COLUMN " description" TEXT ;
Original file line number Diff line number Diff line change 77// }
88
99generator client {
10- provider = " prisma-client-js "
11- engineType = " binary "
10+ provider = " prisma-client-js "
11+ engineType = " binary "
1212}
1313
1414datasource db {
1515 provider = " postgres "
16- url = env (" URL_DATABASE " )
16+ url = env (" DATABASE_URL " )
1717}
1818
1919model User {
20- id Int @id @default (autoincrement () )
21- email String @unique
22- name String
23- passwordHash String ?
24- role String ?
25- function String
26- posts Post []
27- avatarLink String ?
28- createdAt DateTime @default (now () )
29- updatedAt DateTime @default (now () )
30- deletedAt DateTime ?
20+ id Int @id @default (autoincrement () )
21+ email String @unique
22+ name String
23+ description String ?
24+ passwordHash String ?
25+ role String ?
26+ function String
27+ posts Post []
28+ avatarLink String ?
29+ createdAt DateTime @default (now () )
30+ updatedAt DateTime @default (now () )
31+ deletedAt DateTime ?
3132}
3233
3334model Post {
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ export class CreateUserDto {
1515 @IsNotEmpty ( )
1616 name : string ;
1717
18+ @IsOptional ( )
19+ @IsString ( )
20+ description ?: string ;
21+
1822 @IsOptional ( )
1923 @IsUrl ( )
2024 avatarLink ?: string ;
@@ -30,8 +34,4 @@ export class CreateUserDto {
3034 @IsOptional ( )
3135 @IsString ( )
3236 role ?: string ;
33-
34- @IsOptional ( )
35- @IsString ( )
36- description ?: string ;
3737}
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ export class UsersService {
1818 name : true ,
1919 function : true ,
2020 } ,
21+ orderBy : {
22+ id : 'asc' ,
23+ } ,
2124 } ) ;
2225 }
2326
@@ -27,6 +30,7 @@ export class UsersService {
2730 select : {
2831 name : true ,
2932 function : true ,
33+ description : true ,
3034 posts : { where : { isPublished : true } , select : { title : true } } ,
3135 } ,
3236 } ) ;
You can’t perform that action at this time.
0 commit comments