32 lines
985 B
Kotlin
32 lines
985 B
Kotlin
![]() |
package com.example
|
||
|
|
||
|
import kotlinx.serialization.Serializable
|
||
|
import org.jetbrains.exposed.sql.Table
|
||
|
import org.jetbrains.exposed.sql.javatime.timestamp
|
||
|
import java.math.BigDecimal
|
||
|
import java.time.Instant
|
||
|
|
||
|
object Users : Table("users") {
|
||
|
val id = integer("id").autoIncrement()
|
||
|
val name = varchar("name", 255)
|
||
|
val email = varchar("email", 255).uniqueIndex()
|
||
|
val passwordHash = text("password_hash")
|
||
|
val resetToken = text("reset_token").nullable()
|
||
|
val createdAt = timestamp("created_at").default(Instant.now())
|
||
|
|
||
|
override val primaryKey = PrimaryKey(id)
|
||
|
}
|
||
|
|
||
|
object Sneakers : Table("sneakers") {
|
||
|
val id = integer("id").autoIncrement()
|
||
|
val name = varchar("name", 255)
|
||
|
val description = varchar("description", 255)
|
||
|
val cost = decimal("cost", 10, 2)
|
||
|
val discount = integer("discount")
|
||
|
val photo = varchar("photo", 255)
|
||
|
val gender = char("gender")
|
||
|
val bootSize = integer("bootsize")
|
||
|
|
||
|
override val primaryKey = PrimaryKey(id)
|
||
|
}
|