Comments (8)
Hi @twhitbeck! I think this is the same issue as in #31.
Would it be possible to try it again with HEAD?
On the jTDS question, I am assuming you are using the Config object to fetch the driver? It should be possible to add it. I am creating a new issue on this.
from play-slick.
If I am using the dependsOn
method of adding a dependency, am I not automatically using the HEAD version? If not, I'm not sure how to go about trying the HEAD version.
from play-slick.
I pulled the HEAD of play-slick, compiled, and I'm referencing that local project instead of the git:// uri. The issue remains: upon visiting the application I get the Database 'default' needs evolution!
error page, and pressing Apply this script now!
does not apply the evolution.
from play-slick.
Hmm - that is very very strange... Does the evolution scripts still change? If not, is it possible for you to isolate this issue and push it on git so I can try it? That would be great because I need to be able to reproduce your issue to fix it.
Cheers,
Fredrik
from play-slick.
If you look at my github profile, you'll see I've added a repo called play-slick-test
. This is a vanilla play application with play-slick dependency added.
It's configured to use the h2 in-memory database, and everything works as expected. When running the application play alerts me that the default database needs evolution, and clicking the apply evolution button successfully applies it and we move on to the application.
The problem I run into is that as soon as I change the database to point to a local MSSQL database using the microsoft sql server jdbc driver it stops working. The required evolution is successfully picked up, the 1.sql file is correctly created, but it isn't applied to the database and the table isn't created. Interestingly, the play_evolutioons table is created no problem. Not sure why that one succeeds but the other fails.
If you have Microsoft SQL Server you can test it yourself. Otherwise, I wouldn't know how you would. Maybe you could give me some pointers for tracking down the real issue.
I included the microsoft sql server jdbc driver in that repo just in case.
from play-slick.
Thanks for the test repo! I have a colleague that might be able to help me out with MSSQL but it will have to wait till next week :( If I forget to respond by the end of next week I might have forgotten so you can ping me if you want :)
I am thinking this could be a general bug in the Play evolutions, but I am not sure. The reason I think it could be that is that the DDL part of play-slick really just creates the 1.sql evolutions files. The DB plugin in Play is what actually applies it.
To debug this part I would start there and see if it works if you disable/remove the slick plugin and make sure the the 1.sql file is there. If it still does not work, this will have to reported as an issue on the DB plugin in Play itself.
Does that sound about right?
from play-slick.
I should have done this in the first place.
I added these two lines to my application.conf:
db.default.logStatements=true
logger.com.jolbox=DEBUG
And I got some interesting output.
[debug] c.j.b.PreparedStatementHandle - 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', '')
[debug] c.j.b.PreparedStatementHandle - 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
This still resides outside the realm of play-slick, though, correct? The ddl appears to be generated correctly, but in applying it, there are issues with the MSSQL specific datatype, timestamp.
I'll post an issue over at the play github.
from play-slick.
It always easier to see what should have been done in the first place after you do it, so no worries :)
I think you are right and it looks indeed like this outside the realm of play slick...
To me it is not surprising it fails because after a quick look it looks like all the SQL commands for evolutions are the same for all DBs: https://github.com/playframework/Play20/blob/master/framework/src/play-jdbc/src/main/scala/play/api/db/evolutions/Evolutions.scala#L185
Perhaps they could use slick and the Config from play-slick to do this correctly ;)
@twhitbeck: I am closing this issue - reopen if you feel that is wrong
from play-slick.
Related Issues (20)
- Connections not being returned to pool on transaction failure HOT 10
- Cannot acquire connection on many "refresh"
- play 2.7 docs mention play-slick 3.0.0 HOT 2
- Restart connection pools when DB credentials expire HOT 2
- Bump Play version to 2.7.1 HOT 1
- Evolutions fails silently looping the `InvalidDatabaseRevision` for MySQL HOT 1
- Publish for Play 2.7 + slick 3.2? HOT 2
- Unique Indexes break referential integrity. HOT 2
- Evolution script is skipped if there is any Cyrillic character HOT 1
- Why not write Evolutions in Scala ?
- Evolutions are not completed when I access the database programmatically. HOT 15
- Update master Readme to show latest version 5.0.0 HOT 1
- At 5.0.0, Samples don't work HOT 6
- In Play 2.8.2, slick.dbs.default.profile config throws ClassNotFound exception when using custom Profile HOT 4
- Play evolutions throwing error when trying to run it for the first time HOT 10
- please release new version HOT 5
- Unsupported operations post upgrading to scala 2.12 HOT 1
- On startup, evolultion button to apply is disappeared HOT 6
- 6.0.0 Release? HOT 7
- please release new version with slick 3.5.0 final HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-slick.