Permalink
Browse files

Add documentation for default string type changes

  • Loading branch information...
szeiger committed Sep 9, 2015
1 parent ebfb344 commit 5cbabf679d048bc97cccce1f55c53373e0ea57d7
Showing with 11 additions and 1 deletion.
  1. +2 −1 slick/src/main/scala/slick/driver/MySQLDriver.scala
  2. +9 −0 slick/src/sphinx/upgrade.rst
@@ -43,7 +43,8 @@ import slick.jdbc.meta.{MPrimaryKey, MColumn, MTable}
* sequence emulation if you provide for each sequence ''s'' a pair of
* functions <code>s_nextval</code> and <code>s_currval</code>.
*
* The default type for strings of unlimited length is "TEXT". This can be
* The default type for strings of unlimited length is "TEXT", falling back to
* "VARCHAR(254)" if a `Default` or `PrimaryKey` column option is set. This can be
* changed by overriding <code>slick.driver.MySQL.defaultStringType</code>
* in application.conf.
*/
@@ -73,3 +73,12 @@ Slick 3.0 changed the default string type for MySQL to `TEXT`, which is not allo
and columns with default values. In these cases we now fall back to the old `VARCHAR(254)` type which
was used up to Slick 2.1. Like in 3.0 you can change this default by setting the application.conf key
`slick.driver.MySQL.defaultStringType`.
Default String type on SQL Server
---------------------------------
SQLServerDriver (part of :doc:`Slick Extensions <extensions>`) used `VARCHAR(MAX)` as the default type
for strings without a size limit in 3.0. This type cannot be used for primary keys, so we now use
`VARCHAR(254)` instead if a column has the `PrimaryKey` option set. Like for MySQL (see previous
paragraph), the default type can be overridden by setting `slick.driver.SQLServer.defaultStringType`
in application.conf.

0 comments on commit 5cbabf6

Please sign in to comment.