lshift/diffa — Issue #1: Invalid ADD COLUMN syntax on Oracle
Author: 0x6e6562
Created: 2011-11-21 16:22:13+00:00
State: open

The alter table builder produces invalid DDL for Oracle (from standard out):

```
Failed to prepare the database - attempted to execute the following statements for step 12:
________________________________________________________________________________

alter table pair add column allow_manual_scans number(1,0) default 0
________________________________________________________________________________
```

Oracle syntax should not contain the column keyword.

Here is the stack trace:

```
Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1008) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3550) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374) ~[ojdbc6-11.2.0.1.0.jar:11.2.0.1.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0]
at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:242) ~[ucp-11.2.0.1.0.jar:11.2.0.1.0]
at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:124) ~[ucp-11.2.0.1.0.jar:11.2.0.1.0]
at $Proxy9.execute(Unknown Source) ~[na:na]
at net.lshift.hibernate.migrations.TraceableMigrationElement.prepareAndLogAndExecute(TraceableMigrationElement.java:40) ~[hibernate-migrations-1.0.jar:na]
at net.lshift.hibernate.migrations.AlterTableBuilder.apply(AlterTableBuilder.java:128) ~[hibernate-migrations-1.0.jar:na]
at net.lshift.hibernate.migrations.MigrationBuilder.apply(MigrationBuilder.java:89) ~[hibernate-migrations-1.0.jar:na]
at net.lshift.diffa.kernel.config.HibernateConfigStorePreparationStep$$anonfun$prepare$1$$anon$1$$anonfun$execute$1.apply(HibernateConfigStorePreparationStep.scala:85) ~[diffa-kernel-1.0.jar:na]
at net.lshift.diffa.kernel.config.HibernateConfigStorePreparationStep$$anonfun$prepare$1$$anon$1$$anonfun$execute$1.apply(HibernateConfigStorePreparationStep.scala:81) ~[diffa-kernel-1.0.jar:na]
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library-2.9.1.jar:na]
at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library-2.9.1.jar:na]
at net.lshift.diffa.kernel.config.HibernateConfigStorePreparationStep$$anonfun$prepare$1$$anon$1.execute(HibernateConfigStorePreparationStep.scala:81) ~[diffa-kernel-1.0.jar:na]
at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1997) ~[hibernate-core-3.6.7-2L.jar:3.6.7-2L]
... 117 common frames omitted
```