Permalink
Browse files

see the schema

  • Loading branch information...
1 parent d9d4d64 commit 107f3b75cb860d847f5e517d49edc16d2114bbe8 @jamesward committed Jun 8, 2012
Showing with 5 additions and 2 deletions.
  1. +3 −0 app/Global.scala
  2. +2 −2 conf/evolutions/default/1.sql
View
@@ -1,8 +1,10 @@
+import models.AppDB
import org.squeryl.adapters.{H2Adapter, PostgreSqlAdapter}
import org.squeryl.internals.DatabaseAdapter
import org.squeryl.{Session, SessionFactory}
import play.api.db.DB
import play.api.GlobalSettings
+import org.squeryl.PrimitiveTypeMode._
import play.api.Application
@@ -14,6 +16,7 @@ object Global extends GlobalSettings {
case Some("org.postgresql.Driver") => Some(() => getSession(new PostgreSqlAdapter, app))
case _ => sys.error("Database driver must be either org.h2.Driver or org.postgresql.Driver")
}
+ inTransaction(AppDB.printDdl)
}
def getSession(adapter:DatabaseAdapter, app: Application) = Session.create(DB.getConnection()(app), adapter)
@@ -3,8 +3,8 @@
# --- !Ups
create table bar (
- id SERIAL PRIMARY KEY,
- name varchar(255) not null
+ id bigint not null primary key auto_increment,
+ name varchar(128)
);
# --- !Downs

0 comments on commit 107f3b7

Please sign in to comment.