Giter Club home page Giter Club logo

Comments (8)

freekh avatar freekh commented on June 14, 2024

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.

twhitbeck avatar twhitbeck commented on June 14, 2024

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.

twhitbeck avatar twhitbeck commented on June 14, 2024

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.

freekh avatar freekh commented on June 14, 2024

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.

twhitbeck avatar twhitbeck commented on June 14, 2024

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.

freekh avatar freekh commented on June 14, 2024

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.

twhitbeck avatar twhitbeck commented on June 14, 2024

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.

freekh avatar freekh commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.