File tree Expand file tree Collapse file tree 6 files changed +14
-35
lines changed
src/main/kotlin/com/example Expand file tree Collapse file tree 6 files changed +14
-35
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 11package com.example.plugins
22
33import com.example.fake.foodDtos
4+ import com.example.route.userRoute
45import io.ktor.http.*
56import io.ktor.server.application.*
67import io.ktor.server.response.*
@@ -34,4 +35,6 @@ fun Application.configureRouting() {
3435 call.respond(stock)
3536 }
3637 }
38+
39+ userRoute()
3740}
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11package com.example.table
22
3+ import kotlinx.datetime.Clock
4+ import kotlinx.datetime.toJavaInstant
35import org.jetbrains.exposed.sql.javatime.timestamp
46import org.jetbrains.exposed.sql.Table
57
68object Orders: Table() {
79 val id = integer(" id" ).autoIncrement()
8- val userId = integer (" userId" ).references(Users .id )
10+ val userId = uuid (" userId" ).references(Users .userId )
911 val foodId = integer(" foodId" ).references(Foods .id)
1012 val quantity = integer(" quantity" )
11- val orderTime = timestamp(" orderTime" )
13+ val orderTime = timestamp(" orderTime" ).clientDefault { Clock . System .now().toJavaInstant() }
1214
1315 override val primaryKey = PrimaryKey (id)
1416}
Original file line number Diff line number Diff line change @@ -4,13 +4,16 @@ import org.jetbrains.exposed.sql.Table
44
55object Users : Table() {
66 val id = integer(" id" ).autoIncrement()
7+ val userId = uuid(" userId" ).uniqueIndex().autoGenerate()
78 val fullName = varchar(" fullName" , 128 )
89 val email = varchar(" email" , 128 )
910 val password = varchar(" password" , 128 )
10- val phoneNumber = varchar(" phoneNumber" , 128 )
11- val occupation = varchar(" occupation" , 128 )
12- val employer = varchar(" employer" , 128 )
13- val country = varchar(" country" , 128 )
11+ val phoneNumber = varchar(" phoneNumber" , 128 ).nullable()
12+ val occupation = varchar(" occupation" , 128 ).nullable()
13+ val employer = varchar(" employer" , 128 ).nullable()
14+ val country = varchar(" country" , 128 ).nullable()
15+ val latitude = double(" latitude" ).nullable()
16+ val longitude = double(" longitude" ).nullable()
1417
1518 override val primaryKey = PrimaryKey (id)
1619}
You can’t perform that action at this time.
0 commit comments