aboutsummaryrefslogtreecommitdiff
path: root/app/models/Tables.scala
blob: ff1f26791a70cf8653a0c2a2b7576b8d3103a3bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
package models
// AUTO-GENERATED Slick data model
/** Stand-alone Slick data model for immediate use */
object Tables extends {
  val profile = play.api.db.slick.Config.driver
} with Tables

/** Slick data model trait for extension, choice of backend or usage in the cake pattern. (Make sure to initialize this late.) */
trait Tables {
  val profile: scala.slick.driver.JdbcProfile
  import profile.simple._
  import scala.slick.model.ForeignKeyAction
  // NOTE: GetResult mappers for plain SQL are only generated for tables where Slick knows how to map the types of all columns.
  import scala.slick.jdbc.{GetResult => GR}
  
  /** DDL for all tables. Call .create to execute. */
  lazy val ddl = Bids.ddl ++ Charges.ddl ++ Items.ddl ++ Transactions.ddl ++ Users.ddl
  
  /** Entity class storing rows of table Bids
   *  @param uuid Database column uuid DBType(varchar), PrimaryKey, Length(36,true)
   *  @param itemUuid Database column item_uuid DBType(varchar), Length(36,true)
   *  @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)
  /** 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._
    Bid.tupled((<<[String], <<[String], <<[String], <<[java.sql.Timestamp], <<[scala.math.BigDecimal]))
  }
  /** Table description of table bids. Objects of this class serve as prototypes for rows in queries. */
  class Bids(_tableTag: Tag) extends Table[Bid](_tableTag, "bids") {
    def * = (uuid, itemUuid, userUuid, bidDate, offer) <> (Bid.tupled, Bid.unapply)
    /** Maps whole row to an option. Useful for outer joins. */
    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))
    /** 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) */
    val userUuid: Column[String] = column[String]("user_uuid", O.Length(36,varying=true))
    /** Database column bid_date DBType(timestamptz) */
    val bidDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("bid_date")
    /** Database column offer DBType(numeric) */
    val offer: Column[scala.math.BigDecimal] = column[scala.math.BigDecimal]("offer")
    
    /** Foreign key referencing Items (database name bids_items_fk) */
    lazy val itemsFk = foreignKey("bids_items_fk", itemUuid, Items)(r => r.uuid, onUpdate=ForeignKeyAction.NoAction, onDelete=ForeignKeyAction.NoAction)
    /** Foreign key referencing Users (database name bids_users_fk) */
    lazy val usersFk = foreignKey("bids_users_fk", userUuid, Users)(r => r.uuid, onUpdate=ForeignKeyAction.NoAction, onDelete=ForeignKeyAction.NoAction)
  }
  /** Collection-like TableQuery object for table Bids */
  lazy val Bids = new TableQuery(tag => new Bids(tag))
  
  /** Entity class storing rows of table Charges
   *  @param uuid Database column uuid DBType(varchar), PrimaryKey, Length(36,true)
   *  @param startDate Database column start_date DBType(timestamptz)
   *  @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)
  /** 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._
    Charge.tupled((<<[String], <<[java.sql.Timestamp], <<[java.sql.Timestamp], <<[scala.math.BigDecimal], <<[scala.math.BigDecimal]))
  }
  /** Table description of table charges. Objects of this class serve as prototypes for rows in queries. */
  class Charges(_tableTag: Tag) extends Table[Charge](_tableTag, "charges") {
    def * = (uuid, startDate, endDate, fee, rate) <> (Charge.tupled, Charge.unapply)
    /** Maps whole row to an option. Useful for outer joins. */
    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))
    /** Database column start_date DBType(timestamptz) */
    val startDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("start_date")
    /** Database column end_date DBType(timestamptz) */
    val endDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("end_date")
    /** Database column fee DBType(numeric) */
    val fee: Column[scala.math.BigDecimal] = column[scala.math.BigDecimal]("fee")
    /** Database column rate DBType(numeric) */
    val rate: Column[scala.math.BigDecimal] = column[scala.math.BigDecimal]("rate")
  }
  /** Collection-like TableQuery object for table Charges */
  lazy val Charges = new TableQuery(tag => new Charges(tag))
  
  /** Entity class storing rows of table Items
   *  @param uuid Database column uuid DBType(varchar), PrimaryKey, Length(36,true)
   *  @param userUuid Database column user_uuid DBType(varchar), Length(36,true)
   *  @param startDate Database column start_date DBType(timestamptz)
   *  @param endDate Database column end_date DBType(timestamptz)
   *  @param itemName Database column item_name DBType(varchar), Length(20,true)
   *  @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)
  /** 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._
    Item.tupled((<<[String], <<[String], <<[java.sql.Timestamp], <<[java.sql.Timestamp], <<[String], <<[String], <<[String], <<[scala.math.BigDecimal]))
  }
  /** Table description of table items. Objects of this class serve as prototypes for rows in queries. */
  class Items(_tableTag: Tag) extends Table[Item](_tableTag, "items") {
    def * = (uuid, userUuid, startDate, endDate, itemName, shortDesc, longDesc, initialPrice) <> (Item.tupled, Item.unapply)
    /** Maps whole row to an option. Useful for outer joins. */
    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))
    /** 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) */
    val startDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("start_date")
    /** Database column end_date DBType(timestamptz) */
    val endDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("end_date")
    /** Database column item_name DBType(varchar), Length(20,true) */
    val itemName: Column[String] = column[String]("item_name", O.Length(20,varying=true))
    /** Database column short_desc DBType(varchar), Length(30,true) */
    val shortDesc: Column[String] = column[String]("short_desc", O.Length(30,varying=true))
    /** Database column long_desc DBType(text), Length(2147483647,true) */
    val longDesc: Column[String] = column[String]("long_desc", O.Length(2147483647,varying=true))
    /** Database column initial_price DBType(numeric) */
    val initialPrice: Column[scala.math.BigDecimal] = column[scala.math.BigDecimal]("initial_price")
    
    /** Foreign key referencing Users (database name items_users_fk) */
    lazy val usersFk = foreignKey("items_users_fk", userUuid, Users)(r => r.uuid, onUpdate=ForeignKeyAction.NoAction, onDelete=ForeignKeyAction.NoAction)
  }
  /** Collection-like TableQuery object for table Items */
  lazy val Items = new TableQuery(tag => new Items(tag))
  
  /** Entity class storing rows of table Transactions
   *  @param uuid Database column uuid DBType(varchar), PrimaryKey, Length(36,true)
   *  @param userUuid Database column user_uuid DBType(varchar), Length(36,true)
   *  @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)
  /** 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._
    Transaction.tupled((<<[String], <<[String], <<[java.sql.Timestamp], <<[scala.math.BigDecimal], <<[String]))
  }
  /** Table description of table transactions. Objects of this class serve as prototypes for rows in queries. */
  class Transactions(_tableTag: Tag) extends Table[Transaction](_tableTag, "transactions") {
    def * = (uuid, userUuid, transactionDate, amount, label) <> (Transaction.tupled, Transaction.unapply)
    /** Maps whole row to an option. Useful for outer joins. */
    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))
    /** 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) */
    val transactionDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("transaction_date")
    /** Database column amount DBType(numeric) */
    val amount: Column[scala.math.BigDecimal] = column[scala.math.BigDecimal]("amount")
    /** Database column label DBType(varchar), Length(255,true) */
    val label: Column[String] = column[String]("label", O.Length(255,varying=true))
    
    /** Foreign key referencing Users (database name transactions_users_fk) */
    lazy val usersFk = foreignKey("transactions_users_fk", userUuid, Users)(r => r.uuid, onUpdate=ForeignKeyAction.NoAction, onDelete=ForeignKeyAction.NoAction)
  }
  /** Collection-like TableQuery object for table Transactions */
  lazy val Transactions = new TableQuery(tag => new Transactions(tag))
  
  /** Entity class storing rows of table Users
   *  @param uuid Database column uuid DBType(varchar), PrimaryKey, Length(36,true)
   *  @param username Database column username DBType(varchar), Length(20,true)
   *  @param email Database column email DBType(varchar), Length(255,true)
   *  @param userPassword Database column user_password DBType(varchar), Length(255,true)
   *  @param creationDate Database column creation_date DBType(timestamptz)
   *  @param firstName Database column first_name DBType(varchar), Length(255,true)
   *  @param lastName Database column last_name DBType(varchar), Length(255,true)
   *  @param countryCode Database column country_code DBType(varchar), Length(2,true)
   *  @param postalCode Database column postal_code DBType(varchar), Length(20,true)
   *  @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)
  /** 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._
    User.tupled((<<[String], <<[String], <<[String], <<[String], <<[java.sql.Timestamp], <<[String], <<[String], <<[String], <<[String], <<[String], <<[String], <<[java.sql.Timestamp]))
  }
  /** Table description of table users. Objects of this class serve as prototypes for rows in queries. */
  class Users(_tableTag: Tag) extends Table[User](_tableTag, "users") {
    def * = (uuid, username, email, userPassword, creationDate, firstName, lastName, countryCode, postalCode, address, phone, birthdate) <> (User.tupled, User.unapply)
    /** Maps whole row to an option. Useful for outer joins. */
    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))
    /** 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) */
    val email: Column[String] = column[String]("email", O.Length(255,varying=true))
    /** Database column user_password DBType(varchar), Length(255,true) */
    val userPassword: Column[String] = column[String]("user_password", O.Length(255,varying=true))
    /** Database column creation_date DBType(timestamptz) */
    val creationDate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("creation_date")
    /** Database column first_name DBType(varchar), Length(255,true) */
    val firstName: Column[String] = column[String]("first_name", O.Length(255,varying=true))
    /** Database column last_name DBType(varchar), Length(255,true) */
    val lastName: Column[String] = column[String]("last_name", O.Length(255,varying=true))
    /** Database column country_code DBType(varchar), Length(2,true) */
    val countryCode: Column[String] = column[String]("country_code", O.Length(2,varying=true))
    /** Database column postal_code DBType(varchar), Length(20,true) */
    val postalCode: Column[String] = column[String]("postal_code", O.Length(20,varying=true))
    /** Database column address DBType(varchar), Length(255,true) */
    val address: Column[String] = column[String]("address", O.Length(255,varying=true))
    /** Database column phone DBType(varchar), Length(20,true) */
    val phone: Column[String] = column[String]("phone", O.Length(20,varying=true))
    /** Database column birthdate DBType(timestamptz) */
    val birthdate: Column[java.sql.Timestamp] = column[java.sql.Timestamp]("birthdate")
    
    /** Uniqueness Index over (username) (database name username_unique) */
    val index1 = index("username_unique", username, unique=true)
  }
  /** Collection-like TableQuery object for table Users */
  lazy val Users = new TableQuery(tag => new Users(tag))
}