File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
migrations/20221109070931_company_city_ranking Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change
1
+ -- AlterTable
2
+ ALTER TABLE " City" ADD COLUMN " ranking" INTEGER DEFAULT 0 ;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE " Company" ADD COLUMN " ranking" INTEGER DEFAULT 0 ;
Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ model Company {
99
99
description String ? @db.Text
100
100
logoUrl String ?
101
101
website String ?
102
+ // The higher the value of the ranking, the higher it appears in the search results.
103
+ ranking Int ? @default (0 )
102
104
createdAt DateTime @default (now () )
103
105
updatedAt DateTime @updatedAt
104
106
@@ -133,6 +135,8 @@ model City {
133
135
id String @id
134
136
name String
135
137
stateId String
138
+ // The higher the value of the ranking, the higher it appears in the search results.
139
+ ranking Int ? @default (0 )
136
140
state State @relation (fields : [stateId ] , references : [id ] )
137
141
questionsQuestionEncounters QuestionsQuestionEncounter []
138
142
OffersExperience OffersExperience []
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const locationsRouter = createRouter()
10
10
async resolve ( { ctx, input } ) {
11
11
return await ctx . prisma . city . findMany ( {
12
12
orderBy : {
13
- name : 'asc ' ,
13
+ ranking : 'desc ' ,
14
14
} ,
15
15
select : {
16
16
id : true ,
You can’t perform that action at this time.
0 commit comments