We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object Foo: IdTable<Long>(){ override val id = long("id").autoIncrement().entityId().primaryKey() } object Bar: IdTable<Long>(){ override val id = long("id").autoIncrement().entityId().primaryKey() } object Baz: Table(){ val fooId = reference("fooId", Foo.id) val barId = reference("barId", Bar.id) }
this creates SQL
CREATE TABLE IF NOT EXISTS Baz ( fooId BIGINT AUTO_INCREMENT NOT NULL, barId BIGINT AUTO_INCREMENT NOT NULL ...
which cannot succeed. Without the autoIncrement in parent tables everything goes fine.
The text was updated successfully, but these errors were encountered:
Ugly workaround
object Baz: Table(){ val fooId = reference("fooId", Foo.id) val barId = reference("barId", Bar.id) override fun createStatement(): List<String> = super.createStatement() .map { it.replace("AUTO_INCREMENT", "") } }
Sorry, something went wrong.
Thank you for a report. Fixed in master. BTW, you can replace your workaround with:
object Baz: Table(){ val fooId = reference("fooId", Foo) val barId = reference("barId", Bar) }
#385 autoIncrement carries to referencing column
8f798b9
No branches or pull requests
this creates SQL
which cannot succeed. Without the autoIncrement in parent tables everything goes fine.
The text was updated successfully, but these errors were encountered: