mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
fix for column name of table version in exposed standard versions repo proxy
This commit is contained in:
parent
b85ab7b061
commit
223fed910f
@ -27,13 +27,6 @@ sealed interface Either<T1, T2> {
|
|||||||
@Deprecated("Use optionalT2 instead", ReplaceWith("optionalT2"))
|
@Deprecated("Use optionalT2 instead", ReplaceWith("optionalT2"))
|
||||||
val t2: T2?
|
val t2: T2?
|
||||||
get() = optionalT2.dataOrNull()
|
get() = optionalT2.dataOrNull()
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun <T1, T2> serializer(
|
|
||||||
t1Serializer: KSerializer<T1>,
|
|
||||||
t2Serializer: KSerializer<T2>,
|
|
||||||
): KSerializer<Either<T1, T2>> = EitherSerializer(t1Serializer, t2Serializer)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class EitherSerializer<T1, T2>(
|
class EitherSerializer<T1, T2>(
|
||||||
@ -51,7 +44,6 @@ class EitherSerializer<T1, T2>(
|
|||||||
private val t1EitherSerializer = EitherFirst.serializer(t1Serializer, t2Serializer)
|
private val t1EitherSerializer = EitherFirst.serializer(t1Serializer, t2Serializer)
|
||||||
private val t2EitherSerializer = EitherSecond.serializer(t1Serializer, t2Serializer)
|
private val t2EitherSerializer = EitherSecond.serializer(t1Serializer, t2Serializer)
|
||||||
|
|
||||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
|
||||||
override fun deserialize(decoder: Decoder): Either<T1, T2> {
|
override fun deserialize(decoder: Decoder): Either<T1, T2> {
|
||||||
return decoder.decodeStructure(descriptor) {
|
return decoder.decodeStructure(descriptor) {
|
||||||
var type: String? = null
|
var type: String? = null
|
||||||
@ -83,7 +75,6 @@ class EitherSerializer<T1, T2>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@OptIn(ExperimentalSerializationApi::class, InternalSerializationApi::class)
|
|
||||||
override fun serialize(encoder: Encoder, value: Either<T1, T2>) {
|
override fun serialize(encoder: Encoder, value: Either<T1, T2>) {
|
||||||
encoder.encodeStructure(descriptor) {
|
encoder.encodeStructure(descriptor) {
|
||||||
when (value) {
|
when (value) {
|
||||||
|
@ -19,7 +19,7 @@ class ExposedStandardVersionsRepoProxy(
|
|||||||
override val database: Database
|
override val database: Database
|
||||||
) : StandardVersionsRepoProxy<Database>, Table("ExposedVersionsProxy"), ExposedRepo {
|
) : StandardVersionsRepoProxy<Database>, Table("ExposedVersionsProxy"), ExposedRepo {
|
||||||
val tableNameColumn = text("tableName")
|
val tableNameColumn = text("tableName")
|
||||||
val tableVersionColumn = integer("tableName")
|
val tableVersionColumn = integer("tableVersion")
|
||||||
|
|
||||||
init {
|
init {
|
||||||
initTable()
|
initTable()
|
||||||
|
Loading…
Reference in New Issue
Block a user