Permalink
Browse files

fix sql

  • Loading branch information...
1 parent 107f3b7 commit 05cc0b05a8b3000f79aaf0e5b72b574aea64f45f @jamesward committed Jun 8, 2012
Showing with 6 additions and 6 deletions.
  1. +0 −3 app/Global.scala
  2. +6 −3 conf/evolutions/default/1.sql
View
@@ -1,10 +1,8 @@
-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
@@ -16,7 +14,6 @@ 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,10 +3,13 @@
# --- !Ups
create table bar (
- id bigint not null primary key auto_increment,
- name varchar(128)
+ id serial primary key,
+ name varchar(128)
);
+create sequence s_bar_id;
+
# --- !Downs
-drop table if exists bar;
+drop table bar;
+drop sequence s_bar_id;

0 comments on commit 05cc0b0

Please sign in to comment.