From a022850963552096dab032fb57c16d3b1d3ac51a Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 8 Feb 2015 15:47:07 +0100 Subject: Add sign up form and AutoInc on tables uuid --- app/models/Tables.scala | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'app/models') diff --git a/app/models/Tables.scala b/app/models/Tables.scala index ff1f267..24e0aeb 100644 --- a/app/models/Tables.scala +++ b/app/models/Tables.scala @@ -22,7 +22,7 @@ trait Tables { * @param userUuid Database column user_uuid DBType(varchar), Length(36,true) * @param bidDate Database column bid_date DBType(timestamptz) * @param offer Database column offer DBType(numeric) */ - case class Bid(uuid: String, itemUuid: String, userUuid: String, bidDate: java.sql.Timestamp, offer: scala.math.BigDecimal) + case class Bid(uuid: String = null, itemUuid: String, userUuid: String, bidDate: java.sql.Timestamp, offer: scala.math.BigDecimal) /** GetResult implicit for fetching Bid objects using plain SQL queries */ implicit def GetResultBid(implicit e0: GR[String], e1: GR[java.sql.Timestamp], e2: GR[scala.math.BigDecimal]): GR[Bid] = GR{ prs => import prs._ @@ -35,7 +35,7 @@ trait Tables { def ? = (uuid.?, itemUuid.?, userUuid.?, bidDate.?, offer.?).shaped.<>({r=>import r._; _1.map(_=> Bid.tupled((_1.get, _2.get, _3.get, _4.get, _5.get)))}, (_:Any) => throw new Exception("Inserting into ? projection not supported.")) /** Database column uuid DBType(varchar), PrimaryKey, Length(36,true) */ - val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true)) + val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true), O.AutoInc) /** Database column item_uuid DBType(varchar), Length(36,true) */ val itemUuid: Column[String] = column[String]("item_uuid", O.Length(36,varying=true)) /** Database column user_uuid DBType(varchar), Length(36,true) */ @@ -59,7 +59,7 @@ trait Tables { * @param endDate Database column end_date DBType(timestamptz) * @param fee Database column fee DBType(numeric) * @param rate Database column rate DBType(numeric) */ - case class Charge(uuid: String, startDate: java.sql.Timestamp, endDate: java.sql.Timestamp, fee: scala.math.BigDecimal, rate: scala.math.BigDecimal) + case class Charge(uuid: String = null, startDate: java.sql.Timestamp, endDate: java.sql.Timestamp, fee: scala.math.BigDecimal, rate: scala.math.BigDecimal) /** GetResult implicit for fetching Charge objects using plain SQL queries */ implicit def GetResultCharge(implicit e0: GR[String], e1: GR[java.sql.Timestamp], e2: GR[scala.math.BigDecimal]): GR[Charge] = GR{ prs => import prs._ @@ -72,7 +72,7 @@ trait Tables { def ? = (uuid.?, startDate.?, endDate.?, fee.?, rate.?).shaped.<>({r=>import r._; _1.map(_=> Charge.tupled((_1.get, _2.get, _3.get, _4.get, _5.get)))}, (_:Any) => throw new Exception("Inserting into ? projection not supported.")) /** Database column uuid DBType(varchar), PrimaryKey, Length(36,true) */ - val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true)) + val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true), O.AutoInc) /** Database column start_date DBType(timestamptz) */ val startDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("start_date") /** Database column end_date DBType(timestamptz) */ @@ -94,7 +94,7 @@ trait Tables { * @param shortDesc Database column short_desc DBType(varchar), Length(30,true) * @param longDesc Database column long_desc DBType(text), Length(2147483647,true) * @param initialPrice Database column initial_price DBType(numeric) */ - case class Item(uuid: String, userUuid: String, startDate: java.sql.Timestamp, endDate: java.sql.Timestamp, itemName: String, shortDesc: String, longDesc: String, initialPrice: scala.math.BigDecimal) + case class Item(uuid: String = null, userUuid: String, startDate: java.sql.Timestamp, endDate: java.sql.Timestamp, itemName: String, shortDesc: String, longDesc: String, initialPrice: scala.math.BigDecimal) /** GetResult implicit for fetching Item objects using plain SQL queries */ implicit def GetResultItem(implicit e0: GR[String], e1: GR[java.sql.Timestamp], e2: GR[scala.math.BigDecimal]): GR[Item] = GR{ prs => import prs._ @@ -107,7 +107,7 @@ trait Tables { def ? = (uuid.?, userUuid.?, startDate.?, endDate.?, itemName.?, shortDesc.?, longDesc.?, initialPrice.?).shaped.<>({r=>import r._; _1.map(_=> Item.tupled((_1.get, _2.get, _3.get, _4.get, _5.get, _6.get, _7.get, _8.get)))}, (_:Any) => throw new Exception("Inserting into ? projection not supported.")) /** Database column uuid DBType(varchar), PrimaryKey, Length(36,true) */ - val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true)) + val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true), O.AutoInc) /** Database column user_uuid DBType(varchar), Length(36,true) */ val userUuid: Column[String] = column[String]("user_uuid", O.Length(36,varying=true)) /** Database column start_date DBType(timestamptz) */ @@ -135,7 +135,7 @@ trait Tables { * @param transactionDate Database column transaction_date DBType(timestamptz) * @param amount Database column amount DBType(numeric) * @param label Database column label DBType(varchar), Length(255,true) */ - case class Transaction(uuid: String, userUuid: String, transactionDate: java.sql.Timestamp, amount: scala.math.BigDecimal, label: String) + case class Transaction(uuid: String = null, userUuid: String, transactionDate: java.sql.Timestamp, amount: scala.math.BigDecimal, label: String) /** GetResult implicit for fetching Transaction objects using plain SQL queries */ implicit def GetResultTransaction(implicit e0: GR[String], e1: GR[java.sql.Timestamp], e2: GR[scala.math.BigDecimal]): GR[Transaction] = GR{ prs => import prs._ @@ -148,7 +148,7 @@ trait Tables { def ? = (uuid.?, userUuid.?, transactionDate.?, amount.?, label.?).shaped.<>({r=>import r._; _1.map(_=> Transaction.tupled((_1.get, _2.get, _3.get, _4.get, _5.get)))}, (_:Any) => throw new Exception("Inserting into ? projection not supported.")) /** Database column uuid DBType(varchar), PrimaryKey, Length(36,true) */ - val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true)) + val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true), O.AutoInc) /** Database column user_uuid DBType(varchar), Length(36,true) */ val userUuid: Column[String] = column[String]("user_uuid", O.Length(36,varying=true)) /** Database column transaction_date DBType(timestamptz) */ @@ -177,7 +177,7 @@ trait Tables { * @param address Database column address DBType(varchar), Length(255,true) * @param phone Database column phone DBType(varchar), Length(20,true) * @param birthdate Database column birthdate DBType(timestamptz) */ - case class User(uuid: String, username: String, email: String, userPassword: String, creationDate: java.sql.Timestamp, firstName: String, lastName: String, countryCode: String, postalCode: String, address: String, phone: String, birthdate: java.sql.Timestamp) + case class User(uuid: String = null, username: String, email: String, userPassword: String, creationDate: java.sql.Timestamp, firstName: String, lastName: String, countryCode: String, postalCode: String, address: String, phone: String, birthdate: java.sql.Timestamp) /** GetResult implicit for fetching User objects using plain SQL queries */ implicit def GetResultUser(implicit e0: GR[String], e1: GR[java.sql.Timestamp]): GR[User] = GR{ prs => import prs._ @@ -190,7 +190,7 @@ trait Tables { def ? = (uuid.?, username.?, email.?, userPassword.?, creationDate.?, firstName.?, lastName.?, countryCode.?, postalCode.?, address.?, phone.?, birthdate.?).shaped.<>({r=>import r._; _1.map(_=> User.tupled((_1.get, _2.get, _3.get, _4.get, _5.get, _6.get, _7.get, _8.get, _9.get, _10.get, _11.get, _12.get)))}, (_:Any) => throw new Exception("Inserting into ? projection not supported.")) /** Database column uuid DBType(varchar), PrimaryKey, Length(36,true) */ - val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true)) + val uuid: Column[String] = column[String]("uuid", O.PrimaryKey, O.Length(36,varying=true), O.AutoInc) /** Database column username DBType(varchar), Length(20,true) */ val username: Column[String] = column[String]("username", O.Length(20,varying=true)) /** Database column email DBType(varchar), Length(255,true) */ @@ -219,4 +219,4 @@ trait Tables { } /** Collection-like TableQuery object for table Users */ lazy val Users = new TableQuery(tag => new Users(tag)) -} \ No newline at end of file +} -- cgit v1.2.3