liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]]

JIRA | Willem Cazander | 7 months ago
  1. 0

    When adding a default value from sequence like; {code:java} <addDefaultValue columnName="id" defaultValueSequenceNext="my_table_id__seq" schemaName="test" tableName="my_table" /> {code} Then the generated sql forgets the schema so we get exception like; {code:java} liquibase.exception.MigrationFailedException: Migration failed for change set lb_master.xml::init_create_default::lb: Reason: liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:603) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79) at liquibase.Liquibase.update(Liquibase.java:214) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.Liquibase.update(Liquibase.java:188) at liquibase.Liquibase.update(Liquibase.java:181) at TestSequenceMSSQL.testSequenceMSSQL(TestSequenceMSSQL.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1273) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1255) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:566) ... 30 more Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'my_table_id__seq'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299) ... 35 more {code} {code:java} Current sql: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id] Excepted sql: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [test].[my_table_id__seq] FOR [id] {code}

    JIRA | 7 months ago | Willem Cazander
    liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]]
  2. 0

    When adding a default value from sequence like; {code:java} <addDefaultValue columnName="id" defaultValueSequenceNext="my_table_id__seq" schemaName="test" tableName="my_table" /> {code} Then the generated sql forgets the schema so we get exception like; {code:java} liquibase.exception.MigrationFailedException: Migration failed for change set lb_master.xml::init_create_default::lb: Reason: liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:603) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79) at liquibase.Liquibase.update(Liquibase.java:214) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.Liquibase.update(Liquibase.java:188) at liquibase.Liquibase.update(Liquibase.java:181) at TestSequenceMSSQL.testSequenceMSSQL(TestSequenceMSSQL.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1273) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1255) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:566) ... 30 more Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'my_table_id__seq'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299) ... 35 more {code} {code:java} Current sql: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id] Excepted sql: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [test].[my_table_id__seq] FOR [id] {code}

    JIRA | 7 months ago | Willem Cazander
    liquibase.exception.DatabaseException: Invalid object name 'my_table_id__seq'. [Failed SQL: ALTER TABLE [wc_test].[test].[my_table] ADD CONSTRAINT [DF_my_table_id] DEFAULT NEXT VALUE FOR [my_table_id__seq] FOR [id]]
  3. 0

    GitHub comment 1690#176127452

    GitHub | 10 months ago | ruan0011
    liquibase.exception.DatabaseException: The object 'UQ__user__AB6E6164EA813277' is dependent on column 'email'. [Failed SQL: ALTER TABLE [dbo].[user] ALTER COLUMN [email] [varchar](128)]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 1690#176601458

    GitHub | 10 months ago | ruan0011
    liquibase.exception.DatabaseException: The object 'UQ__user__AB6E6164EA813277' is dependent on column 'email'. [Failed SQL: ALTER TABLE [dbo].[user] ALTER COLUMN [email] [varchar](128)]
  6. 0

    GitHub comment 2011#225344249

    GitHub | 6 months ago | mrameezraja
    liquibase.exception.DatabaseException: The object 'DF_users_language' is dependent on column 'language'. [Failed SQL: ALTER TABLE [dbo].[users] DROP COLUMN [language]]

    9 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.microsoft.sqlserver.jdbc.SQLServerException

      Invalid object name 'my_table_id__seq'.

      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError()
    2. com.microsoft.sqlserver
      SQLServerStatement.execute
      1. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
      2. com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)
      3. com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792)
      4. com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
      5. com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
      6. com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
      7. com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
      8. com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
      9. com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662)
      9 frames
    3. Liquibase Core
      Liquibase.update
      1. liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299)
      2. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
      3. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107)
      4. liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1273)
      5. liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1255)
      6. liquibase.changelog.ChangeSet.execute(ChangeSet.java:566)
      7. liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
      8. liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
      9. liquibase.Liquibase.update(Liquibase.java:214)
      10. liquibase.Liquibase.update(Liquibase.java:192)
      11. liquibase.Liquibase.update(Liquibase.java:188)
      12. liquibase.Liquibase.update(Liquibase.java:181)
      12 frames
    4. Unknown
      TestSequenceMSSQL.testSequenceMSSQL
      1. TestSequenceMSSQL.testSequenceMSSQL(TestSequenceMSSQL.java:36)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    6. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      13. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      13 frames
    7. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      1 frame
    8. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      5 frames