Comments (6)
I verified the index diff is now created correctly:
databaseChangeLog = {
changeSet(author: "jameskleeh (generated)", id: "1477666371113-1") {
createIndex(indexName: "apitoken_Idx", tableName: "person") {
column(name: "api_token")
column(name: "device_id")
}
}
}
from grails-database-migration.
Sample application see https://github.com/robertoschwald/grails-database-migration-issue74-example
from grails-database-migration.
When using Grails 2.4.4 with dbm plugin 1.4.0 using the same sample domain class as stated above, the indexes are created correctly:
databaseChangeLog = {
changeSet(author: "roos (generated)", id: "1465201783236-1") {
createTable(tableName: "api_access_token") {
column(autoIncrement: "true", name: "id", type: "bigint") {
constraints(nullable: "false", primaryKey: "true", primaryKeyName: "api_access_toPK")
}
column(name: "version", type: "bigint") {
constraints(nullable: "false")
}
column(name: "api_token", type: "varchar(255)") {
constraints(nullable: "false")
}
column(name: "device_id", type: "varchar(255)") {
constraints(nullable: "false")
}
}
}
changeSet(author: "roos (generated)", id: "1465201783236-2") {
createIndex(indexName: "apitoken_Idx", tableName: "api_access_token") {
column(name: "api_token")
column(name: "device_id")
}
}
changeSet(author: "roos (generated)", id: "1465201783236-3") {
createIndex(indexName: "unique_api_token", tableName: "api_access_token", unique: "true") {
column(name: "device_id")
column(name: "api_token")
}
}
}
from grails-database-migration.
Liquibase seems to detect the apitoken_Idx index correctly. diffResult in GroovyDiffToChangeLogCommand contains the index, but the serializer does not seem to generate the changelog entry:
INFO liquibase-hibernate - Found table api_access_token
INFO liquibase-hibernate - Found unique constraint null on api_access_token(device_id, api_token)
WARN liquibase-hibernate - Hibernate primary key name is probably truncated. api_access_toPK
WARN liquibase-hibernate - Changing hibernate primary key name to api_access_tokenPK
INFO liquibase-hibernate - Found primary key api_access_tokenPK
INFO liquibase-hibernate - Found index apitoken_Idx
INFO liquibase-hibernate - Found column id bigint
INFO liquibase-hibernate - Found column version bigint
INFO liquibase-hibernate - Found column api_token varchar(255)
INFO liquibase-hibernate - Found column device_id varchar(255)
INFO liquibase-hibernate - Found index apitoken_Idx
So seems to be a Liquibase 3.5 problem. See liquibase/liquibase-hibernate#100
from grails-database-migration.
As stated in the liquibase issue I referenced, HibernateDatabase is blacklisted in some migration types of newer Liquibase versions. Therefore, normal indexes are currently not supported when using plugin version 2.0.0.x. I contacted the Liquibase author.
from grails-database-migration.
@robertoschwald This should be fixed in version 3.0.0.BUILD-SNAPSHOT
of the plugin that supports hibernate 5. Can you confirm that?
from grails-database-migration.
Related Issues (20)
- Grails 5.0.0rc1 dependency issues HOT 1
- Dependency Dashboard
- dbm-gorm-diff fails (Grails4/Gradle 5.6.4 and plugin version 3.1.0) HOT 4
- EnversService#initialize should be called only once HOT 2
- Action Required: Fix Renovate Configuration
- 4.0.0-RC1 missing dependencies HOT 3
- Missing several commands
- dbm-generate-gorm-changelog and dbm-generate-changelog both fail to generate the correct byte array MySQL type HOT 10
- migration scripts not working with Grails 5.0.3 HOT 1
- The links to the documentation are not working HOT 2
- Grails 5.1.1 broken: No such property: instance for class: liquibase.servicelocator.ServiceLocator HOT 3
- Exception deploying war in tomcat with version 4.0.0 HOT 4
- derby.log is created after upgrading 4.0.0 HOT 2
- | Error Command not found dbm-register-changelog HOT 1
- dbm-gorm-diff fails on multiproject build HOT 1
- Exception deploying war in tomcat with version 4.1.0 HOT 1
- Unable to generate liquibase XML using the filename extension
- Unable to use grailsChange in changelog with liquibase >= 4
- Upgrade to v4.18.0 of liquibase-hibernate HOT 1
- NoClassDefFoundError since Liquibase 4.20.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grails-database-migration.