Skip to content

Commit

Permalink
added autogenerating method for uuid columns (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
red-avtovo authored and Tapac committed Oct 26, 2019
1 parent 71e892c commit 6257f17
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ open class Table(name: String = ""): ColumnSet(), DdlAware {
replaceColumn(this@autoIncrement, this)
}

fun Column<UUID>.autoGenerate(): Column<UUID> = this.clientDefault { UUID.randomUUID() }

fun <N:Comparable<N>> Column<EntityID<N>>.autoinc(idSeqName: String? = null): Column<EntityID<N>> = cloneWithAutoInc(idSeqName).apply {
replaceColumn(this@autoinc, this)
Expand Down

0 comments on commit 6257f17

Please sign in to comment.