Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Grails更改现有数据库上的ID类型_Mysql_Grails_Gorm - Fatal编程技术网

Mysql Grails更改现有数据库上的ID类型

Mysql Grails更改现有数据库上的ID类型,mysql,grails,gorm,Mysql,Grails,Gorm,我有一个grails中的现有应用程序,它使用mysql数据库和大量数据。前面的程序员使用int作为id,我需要更改为long,因为我的id已经用完了。我知道域类中的更改不会更新现有表的列。是否手动更改mysql中的类型?是,更改域类后手动更改列 另外,我认为最好先将dbUpdate设置为“createdrop”,然后(在另一个DB实例上)尝试让Grails生成新的模式,看看它是否像您所期望的那样 因此,请更改域,生成测试架构并检查其是否正确,然后手动更改原始数据库。有一种东西叫做数据库迁移。。。

我有一个grails中的现有应用程序,它使用mysql数据库和大量数据。前面的程序员使用int作为id,我需要更改为long,因为我的id已经用完了。我知道域类中的更改不会更新现有表的列。是否手动更改mysql中的类型?

是,更改域类后手动更改列

另外,我认为最好先将dbUpdate设置为“createdrop”,然后(在另一个DB实例上)尝试让Grails生成新的模式,看看它是否像您所期望的那样


因此,请更改域,生成测试架构并检查其是否正确,然后手动更改原始数据库。

有一种东西叫做数据库迁移。。。有一个插件