架构验证:在表[testTable]的列[name]中遇到错误的列类型



我在启动springboot应用程序时遇到这个错误:

Schema-validation: wrong column type encountered in column [name] in table [testTable];
found [character (Types#VARCHAR)], but expecting [clob (Types#CLOB)]

我团队的其他人可以很好地运行它,但它对我不起作用。

这是我的课:

@Entity
@Table(name = "testTable")
data class TestTable(
@Id
val id: Long,
@Lob
@Column
val name: String,
@Column(nullable = false)
val parentId: Long,

我想这是地图绘制的问题,但我不明白为什么其他人没有这个问题。

提前谢谢。

团队中的其他人可能使用不同的数据库模式。错误表明您的模型需要CLOB列类型(由于使用了@Lob(,但数据库列的类型为VARCHAR。如果要使用此架构,请删除@Lob注释。否则,将列迁移到CLOB:alter table testTable alter column name set data type clob

最新更新