Skip to content

Commit

Permalink
feat: add a unique index at Strategies.name
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiinaKin committed Sep 23, 2024
1 parent 23ec71e commit 86ed885
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import org.jetbrains.exposed.sql.kotlin.datetime.datetime
* 2024/9/7 14:03
*/
object Strategies : LongIdTable("strategies") {
val name = varchar("name", 255)
// Although this will cause an index rebuild when this field is updated,
// this table won't have a lot of data, so it's fine.
val name = varchar("name", 255).uniqueIndex()
val config = json<StrategyConfig>("config", jsonFormat)
val createTime = datetime("create_time")
val updateTime = datetime("update_time")
Expand Down

0 comments on commit 86ed885

Please sign in to comment.