I'm not sure if I have a configuration problem, or if this is a bug with Play.
I'm using Microsoft SQL Server 2008 R2.
Steps to reproduce:
- Create a new play application with play new
- Add the microsoft sql server driver sqljdbc4.jar to the "lib" folder
- Adjust application.conf to point to a local, running instance of sql server and a freshly created, empty database
- Add 1.sql to conf/evolutions/default/ with these contents:
# --- !Ups
create table "smi" ("id" INTEGER NOT NULL PRIMARY KEY,"ro_number" VARCHAR(254) NOT NULL);
# --- !Downs
drop table "smi";
When I navigate to the application, I get the expected error page 'Database 'default' needs evolution!'
However, when I click 'Apply this script now!' the page simply refreshes and I still see the error.
The play_evolutions table is successfully created, but my table was not created. These lines are in the log file:
2013-03-07 12:57:06,040 - [DEBUG] - from com.jolbox.bonecp.PreparedStatementHandle in New I/O worker #1
insert into play_evolutions values(1, 'c46eefa343788f2604ef159f0e0faf0978f19a7c', 2013-03-07, 'create table "smi" ("id" INTEGER NOT NULL PRIMARY KEY,"ro_number" VARCHAR(254) NOT NULL);', 'drop table "smi";', 'applying_up', '')
2013-03-07 12:57:06,060 - [DEBUG] - from com.jolbox.bonecp.PreparedStatementHandle in New I/O worker #1
update play_evolutions set last_problem = 'Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column. [ERROR:273, SQLSTATE:S0001]' where id = 1
The problem appears to be attempting to set a column of type "timestamp" with a value of 2013-03-7.