0
I created a table but when I run the application more than once it gives this problem. Why does this happen?
environments {
development{
dataSource {
dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:jtds:sqlserver://localhost:1433/G2017;instance=SQLEXPRESS";
username = "sa"
password = "G2017"
loggingSql = false
}
}
Error |
2015-12-29 20:06:21,141 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - HHH000388: Unsuccessful: alter table MATERIAL_CONSULTA add MCO_ANE_in_id bigint not null
Error |
2015-12-29 20:06:21,156 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - Column names in each table must be unique. Column name 'MCO_ANE_in_id' in table 'MATERIAL_CONSULTA' is specified more than once.
Error |
2015-12-29 20:06:21,177 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - HHH000388: Unsuccessful: alter table MATERIAL_CONSULTA add constraint FK_3u9950vreiqdafld873700mg5 foreign key (MCO_ANE_in_id ) references ANEXO
Error |
2015-12-29 20:06:21,177 [localhost-startStop-1] ERROR hbm2ddl.SchemaUpdate - There is already an object named 'FK_3u9950vreiqdafld873700mg5' in the database.
What version of Grails? You can post your Datasource.groovy?
– cantoni
2.5.1 version of the grails
– Aline Gonz
Column name 'Mco_ane_in_id' in table 'MATERIAL_CONSULTA' is specified more than Once.
– Aline Gonz
You could post your Datasource.groovy?
– cantoni
This application has many classes but when I created this gave this problem that I do not know how to solve :(
– Aline Gonz
The error is very clear: GORM is trying to create the Mco_ane_in_id field in the MATERIAL_CONSULTA table, but it already exists. The same happens when trying to create the foreign key. Anyway, GORM is not identifying that these items already exist in the BD. Tried to create a bank from scratch to see if everything works?
– cantoni
I already erased the bank and created again and I did everything again but it gives the same problem... What I do??????????
– Aline Gonz
Friend? I changed the name of the field and it worked.
– Aline Gonz