{"action":"created","issue":{"url":"https://api.github.com/repos/builtamont-oss/cassandra-migration/issues/15","repository_url":"https://api.github.com/repos/builtamont-oss/cassandra-migration","labels_url":"https://api.github.com/repos/builtamont-oss/cassandra-migration/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/builtamont-oss/cassandra-migration/issues/15/comments","events_url":"https://api.github.com/repos/builtamont-oss/cassandra-migration/issues/15/events","html_url":"https://github.com/builtamont-oss/cassandra-migration/issues/15","id":179649507,"number":15,"title":"When using externally created Session without specifying KeyspaceConfiguration, migration fails to initialize migration tables","user":{"login":"james-hu","id":8565700,"avatar_url":"https://avatars.githubusercontent.com/u/8565700?v=3","gravatar_id":"","url":"https://api.github.com/users/james-hu","html_url":"https://github.com/james-hu","followers_url":"https://api.github.com/users/james-hu/followers","following_url":"https://api.github.com/users/james-hu/following{/other_user}","gists_url":"https://api.github.com/users/james-hu/gists{/gist_id}","starred_url":"https://api.github.com/users/james-hu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-hu/subscriptions","organizations_url":"https://api.github.com/users/james-hu/orgs","repos_url":"https://api.github.com/users/james-hu/repos","events_url":"https://api.github.com/users/james-hu/events{/privacy}","received_events_url":"https://api.github.com/users/james-hu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"hhandoko","id":771674,"avatar_url":"https://avatars.githubusercontent.com/u/771674?v=3","gravatar_id":"","url":"https://api.github.com/users/hhandoko","html_url":"https://github.com/hhandoko","followers_url":"https://api.github.com/users/hhandoko/followers","following_url":"https://api.github.com/users/hhandoko/following{/other_user}","gists_url":"https://api.github.com/users/hhandoko/gists{/gist_id}","starred_url":"https://api.github.com/users/hhandoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhandoko/subscriptions","organizations_url":"https://api.github.com/users/hhandoko/orgs","repos_url":"https://api.github.com/users/hhandoko/repos","events_url":"https://api.github.com/users/hhandoko/events{/privacy}","received_events_url":"https://api.github.com/users/hhandoko/received_events","type":"User","site_admin":false},"assignees":[{"login":"hhandoko","id":771674,"avatar_url":"https://avatars.githubusercontent.com/u/771674?v=3","gravatar_id":"","url":"https://api.github.com/users/hhandoko","html_url":"https://github.com/hhandoko","followers_url":"https://api.github.com/users/hhandoko/followers","following_url":"https://api.github.com/users/hhandoko/following{/other_user}","gists_url":"https://api.github.com/users/hhandoko/gists{/gist_id}","starred_url":"https://api.github.com/users/hhandoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhandoko/subscriptions","organizations_url":"https://api.github.com/users/hhandoko/orgs","repos_url":"https://api.github.com/users/hhandoko/repos","events_url":"https://api.github.com/users/hhandoko/events{/privacy}","received_events_url":"https://api.github.com/users/hhandoko/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-09-28T00:16:20Z","updated_at":"2016-11-16T08:55:48Z","closed_at":null,"body":"## Expected Behaviour\n\n_When using externally created Session, KeyspaceConfiguration should be optional_\n\n<hr>\n## Actual Behaviour\n\n_When using externally created Session without specifying KeyspaceConfiguration, migration fails to initialize migration tables_\n\nBelow is the log / error trace:\n\n```\n10:12:15.068 [main] DEBUG c.b.c.m.i.dbsupport.SchemaVersionDAO - No schema version table found with a name of cassandra_migration_version\n10:12:15.070 [main] DEBUG c.b.c.m.i.dbsupport.SchemaVersionDAO - No schema version counts table found with a name of cassandra_migration_version_counts\n\ncom.datastax.driver.core.exceptions.SyntaxError: line 1:27 no viable alternative at input 'null' (CREATE TABLE IF NOT EXISTS [null]...)\n\n    at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:58)\n    at com.datastax.driver.core.exceptions.SyntaxError.copy(SyntaxError.java:24)\n    at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)\n    at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)\n    at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:64)\n    at com.builtamont.cassandra.migration.internal.dbsupport.SchemaVersionDAO.createTablesIfNotExist(SchemaVersionDAO.java:102)\n    at com.builtamont.cassandra.migration.internal.command.Initialize.run(Initialize.kt:39)\n    at com.builtamont.cassandra.migration.CassandraMigration$migrateAction$1.execute(CassandraMigration.kt:331)\n    at com.builtamont.cassandra.migration.CassandraMigration$migrateAction$1.execute(CassandraMigration.kt:329)\n    at com.builtamont.cassandra.migration.CassandraMigration.execute$cassandra_migration(CassandraMigration.kt:284)\n    at com.builtamont.cassandra.migration.CassandraMigration.migrate(CassandraMigration.kt:133)\n    at ****************.afterPropertiesSet(Database.java:57)\n    at ************.DatabaseIntegrationTest.testMigration(DatabaseIntegrationTest.java:16)\n    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n    at java.lang.reflect.Method.invoke(Method.java:498)\n    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)\n    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)\n    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)\n    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\n    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\n    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\n    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\n    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\n    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)\n    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)\n    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)\n    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)\n    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)\n    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)\n    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n    at java.lang.reflect.Method.invoke(Method.java:498)\n    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)\nCaused by: com.datastax.driver.core.exceptions.SyntaxError: line 1:27 no viable alternative at input 'null' (CREATE TABLE IF NOT EXISTS [null]...)\n    at com.datastax.driver.core.Responses$Error.asException(Responses.java:132)\n    at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)\n    at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:174)\n    at com.datastax.driver.core.RequestHandler.access$2600(RequestHandler.java:43)\n    at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:793)\n    at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:627)\n    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1012)\n    at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:935)\n    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)\n    at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)\n    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)\n    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)\n    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:321)\n    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1280)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)\n    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:328)\n    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:890)\n    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)\n    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:564)\n    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:505)\n    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:419)\n    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:391)\n    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)\n    at java.lang.Thread.run(Thread.java:745)\n```\n\n<hr>\n## Steps to Reproduce\n- Cassandra 3.0.8 running locally in a docker image\n- Datastax driver 3.1.0\n- Use 'com.builtamont:cassandra-migration:0.9-SNAPSHOT'\n- Make sure that `cassandra_migration*` tables do not exist in the keyspace\n- comment the line `cm.setKeyspaceConfig(keyspaceConfig);` as below:\n\n``` java\n        KeyspaceConfiguration keyspaceConfig = new KeyspaceConfiguration();\n        keyspaceConfig.setName(keySpace);\n        CassandraMigration cm = new CassandraMigration();\n        //cm.setKeyspaceConfig(keyspaceConfig);\n        cm.migrate(session);\n```\n"},"comment":{"url":"https://api.github.com/repos/builtamont-oss/cassandra-migration/issues/comments/260889404","html_url":"https://github.com/builtamont-oss/cassandra-migration/issues/15#issuecomment-260889404","issue_url":"https://api.github.com/repos/builtamont-oss/cassandra-migration/issues/15","id":260889404,"user":{"login":"hhandoko","id":771674,"avatar_url":"https://avatars.githubusercontent.com/u/771674?v=3","gravatar_id":"","url":"https://api.github.com/users/hhandoko","html_url":"https://github.com/hhandoko","followers_url":"https://api.github.com/users/hhandoko/followers","following_url":"https://api.github.com/users/hhandoko/following{/other_user}","gists_url":"https://api.github.com/users/hhandoko/gists{/gist_id}","starred_url":"https://api.github.com/users/hhandoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhandoko/subscriptions","organizations_url":"https://api.github.com/users/hhandoko/orgs","repos_url":"https://api.github.com/users/hhandoko/repos","events_url":"https://api.github.com/users/hhandoko/events{/privacy}","received_events_url":"https://api.github.com/users/hhandoko/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T08:55:48Z","updated_at":"2016-11-16T08:55:48Z","body":"Local integration test passes, but CI is throwing some errors so I'll need to do a bit of investigation.\r\n\r\nHowever, you can check what has been implemented, @james-hu , and see if this would work for your scenario."}}
{"actor":{"display_login":"hhandoko"}}