From dab5bbdb33d8cc81bb50ea7c96d31091961d0348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Fri, 15 Sep 2023 22:32:34 +0200 Subject: [PATCH] Add constraints to `UnsavedRow` types (#36) --- .../employee/EmployeeRowUnsaved.scala | 18 ++++++---- .../EmployeedepartmenthistoryRowUnsaved.scala | 6 ++-- .../EmployeepayhistoryRowUnsaved.scala | 6 ++-- .../person/person/PersonRowUnsaved.scala | 6 ++-- .../BillofmaterialsRowUnsaved.scala | 20 +++++++---- .../document/DocumentRowUnsaved.scala | 3 +- .../location/LocationRowUnsaved.scala | 6 ++-- .../product/ProductRowUnsaved.scala | 33 ++++++++++++------- .../ProductcosthistoryRowUnsaved.scala | 9 +++-- .../ProductinventoryRowUnsaved.scala | 3 +- .../ProductlistpricehistoryRowUnsaved.scala | 9 +++-- .../ProductreviewRowUnsaved.scala | 3 +- .../TransactionhistoryRowUnsaved.scala | 3 +- .../TransactionhistoryarchiveRowUnsaved.scala | 3 +- .../workorder/WorkorderRowUnsaved.scala | 12 ++++--- .../WorkorderroutingRowUnsaved.scala | 21 ++++++++---- .../ProductvendorRowUnsaved.scala | 18 ++++++---- .../PurchaseorderdetailRowUnsaved.scala | 12 ++++--- .../PurchaseorderheaderRowUnsaved.scala | 18 ++++++---- .../shipmethod/ShipmethodRowUnsaved.scala | 6 ++-- .../purchasing/vendor/VendorRowUnsaved.scala | 3 +- .../SalesorderdetailRowUnsaved.scala | 9 +++-- .../SalesorderheaderRowUnsaved.scala | 22 +++++++++---- .../salesperson/SalespersonRowUnsaved.scala | 15 ++++++--- .../SalespersonquotahistoryRowUnsaved.scala | 3 +- .../salestaxrate/SalestaxrateRowUnsaved.scala | 3 +- .../SalesterritoryRowUnsaved.scala | 12 ++++--- .../SalesterritoryhistoryRowUnsaved.scala | 6 ++-- .../ShoppingcartitemRowUnsaved.scala | 3 +- .../specialoffer/SpecialofferRowUnsaved.scala | 15 ++++++--- .../employee/EmployeeRowUnsaved.scala | 18 ++++++---- .../EmployeedepartmenthistoryRowUnsaved.scala | 6 ++-- .../EmployeepayhistoryRowUnsaved.scala | 6 ++-- .../person/person/PersonRowUnsaved.scala | 6 ++-- .../BillofmaterialsRowUnsaved.scala | 20 +++++++---- .../document/DocumentRowUnsaved.scala | 3 +- .../location/LocationRowUnsaved.scala | 6 ++-- .../product/ProductRowUnsaved.scala | 33 ++++++++++++------- .../ProductcosthistoryRowUnsaved.scala | 9 +++-- .../ProductinventoryRowUnsaved.scala | 3 +- .../ProductlistpricehistoryRowUnsaved.scala | 9 +++-- .../ProductreviewRowUnsaved.scala | 3 +- .../TransactionhistoryRowUnsaved.scala | 3 +- .../TransactionhistoryarchiveRowUnsaved.scala | 3 +- .../workorder/WorkorderRowUnsaved.scala | 12 ++++--- .../WorkorderroutingRowUnsaved.scala | 21 ++++++++---- .../ProductvendorRowUnsaved.scala | 18 ++++++---- .../PurchaseorderdetailRowUnsaved.scala | 12 ++++--- .../PurchaseorderheaderRowUnsaved.scala | 18 ++++++---- .../shipmethod/ShipmethodRowUnsaved.scala | 6 ++-- .../purchasing/vendor/VendorRowUnsaved.scala | 3 +- .../SalesorderdetailRowUnsaved.scala | 9 +++-- .../SalesorderheaderRowUnsaved.scala | 22 +++++++++---- .../salesperson/SalespersonRowUnsaved.scala | 15 ++++++--- .../SalespersonquotahistoryRowUnsaved.scala | 3 +- .../salestaxrate/SalestaxrateRowUnsaved.scala | 3 +- .../SalesterritoryRowUnsaved.scala | 12 ++++--- .../SalesterritoryhistoryRowUnsaved.scala | 6 ++-- .../ShoppingcartitemRowUnsaved.scala | 3 +- .../specialoffer/SpecialofferRowUnsaved.scala | 15 ++++++--- .../typo/internal/codegen/FilesTable.scala | 3 +- 61 files changed, 412 insertions(+), 203 deletions(-) diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala index 3fe54a8a7b..01ba4261d1 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala @@ -34,22 +34,28 @@ case class EmployeeRowUnsaved( loginid: /* max 256 chars */ String, /** Work title such as Buyer or Sales Representative. */ jobtitle: /* max 50 chars */ String, - /** Date of birth. */ + /** Date of birth. + Constraint CK_Employee_BirthDate affecting columns "birthdate": (((birthdate >= '1930-01-01'::date) AND (birthdate <= (now() - '18 years'::interval)))) */ birthdate: TypoLocalDate, - /** M = Married, S = Single */ + /** M = Married, S = Single + Constraint CK_Employee_MaritalStatus affecting columns "maritalstatus": ((upper((maritalstatus)::text) = ANY (ARRAY['M'::text, 'S'::text]))) */ maritalstatus: /* bpchar, max 1 chars */ String, - /** M = Male, F = Female */ + /** M = Male, F = Female + Constraint CK_Employee_Gender affecting columns "gender": ((upper((gender)::text) = ANY (ARRAY['M'::text, 'F'::text]))) */ gender: /* bpchar, max 1 chars */ String, - /** Employee hired on this date. */ + /** Employee hired on this date. + Constraint CK_Employee_HireDate affecting columns "hiredate": (((hiredate >= '1996-07-01'::date) AND (hiredate <= (now() + '1 day'::interval)))) */ hiredate: TypoLocalDate, /** Default: true Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. */ salariedflag: Defaulted[Flag] = Defaulted.UseDefault, /** Default: 0 - Number of available vacation hours. */ + Number of available vacation hours. + Constraint CK_Employee_VacationHours affecting columns "vacationhours": (((vacationhours >= '-40'::integer) AND (vacationhours <= 240))) */ vacationhours: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: 0 - Number of available sick leave hours. */ + Number of available sick leave hours. + Constraint CK_Employee_SickLeaveHours affecting columns "sickleavehours": (((sickleavehours >= 0) AND (sickleavehours <= 120))) */ sickleavehours: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: true 0 = Inactive, 1 = Active */ diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala index de1ca7aa3c..f7dbeef18a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala @@ -33,9 +33,11 @@ case class EmployeedepartmenthistoryRowUnsaved( /** Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. Points to [[shift.ShiftRow.shiftid]] */ shiftid: ShiftId, - /** Date the employee started work in the department. */ + /** Date the employee started work in the department. + Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDate, - /** Date the employee left the department. NULL = Current department. */ + /** Date the employee left the department. NULL = Current department. + Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDate], /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala index d1ddfc4662..3fb5e9ad8a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala @@ -27,9 +27,11 @@ case class EmployeepayhistoryRowUnsaved( businessentityid: BusinessentityId, /** Date the change in pay is effective */ ratechangedate: TypoLocalDateTime, - /** Salary hourly rate. */ + /** Salary hourly rate. + Constraint CK_EmployeePayHistory_Rate affecting columns "rate": (((rate >= 6.50) AND (rate <= 200.00))) */ rate: BigDecimal, - /** 1 = Salary received monthly, 2 = Salary received biweekly */ + /** 1 = Salary received monthly, 2 = Salary received biweekly + Constraint CK_EmployeePayHistory_PayFrequency affecting columns "payfrequency": ((payfrequency = ANY (ARRAY[1, 2]))) */ payfrequency: TypoShort, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala index f12249e233..e8bf23f0bc 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala @@ -29,7 +29,8 @@ case class PersonRowUnsaved( /** Primary key for Person records. Points to [[businessentity.BusinessentityRow.businessentityid]] */ businessentityid: BusinessentityId, - /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact */ + /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact + Constraint CK_Person_PersonType affecting columns "persontype": (((persontype IS NULL) OR (upper((persontype)::text) = ANY (ARRAY['SC'::text, 'VC'::text, 'IN'::text, 'EM'::text, 'SP'::text, 'GC'::text])))) */ persontype: /* bpchar, max 2 chars */ String, /** A courtesy title. For example, Mr. or Ms. */ title: Option[/* max 8 chars */ String], @@ -49,7 +50,8 @@ case class PersonRowUnsaved( 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. */ namestyle: Defaulted[NameStyle] = Defaulted.UseDefault, /** Default: 0 - 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. */ + 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. + Constraint CK_Person_EmailPromotion affecting columns "emailpromotion": (((emailpromotion >= 0) AND (emailpromotion <= 2))) */ emailpromotion: Defaulted[Int] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala index 1219190c38..2eb43e1f18 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala @@ -24,26 +24,34 @@ import scala.util.Try /** This class corresponds to a row in table `production.billofmaterials` which has not been persisted yet */ case class BillofmaterialsRowUnsaved( /** Parent product identification number. Foreign key to Product.ProductID. - Points to [[product.ProductRow.productid]] */ + Points to [[product.ProductRow.productid]] + Constraint CK_BillOfMaterials_BOMLevel affecting columns "bomlevel", "productassemblyid", "perassemblyqty": ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) + Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns "productassemblyid", "componentid": ((productassemblyid <> componentid)) */ productassemblyid: Option[ProductId], /** Component identification number. Foreign key to Product.ProductID. - Points to [[product.ProductRow.productid]] */ + Points to [[product.ProductRow.productid]] + Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns "productassemblyid", "componentid": ((productassemblyid <> componentid)) */ componentid: ProductId, - /** Date the component stopped being used in the assembly item. */ + /** Date the component stopped being used in the assembly item. + Constraint CK_BillOfMaterials_EndDate affecting columns "enddate", "startdate": (((enddate > startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], /** Standard code identifying the unit of measure for the quantity. Points to [[unitmeasure.UnitmeasureRow.unitmeasurecode]] */ unitmeasurecode: UnitmeasureId, - /** Indicates the depth the component is from its parent (AssemblyID). */ + /** Indicates the depth the component is from its parent (AssemblyID). + Constraint CK_BillOfMaterials_BOMLevel affecting columns "bomlevel", "productassemblyid", "perassemblyqty": ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) */ bomlevel: TypoShort, /** Default: nextval('production.billofmaterials_billofmaterialsid_seq'::regclass) Primary key for BillOfMaterials records. */ billofmaterialsid: Defaulted[BillofmaterialsId] = Defaulted.UseDefault, /** Default: now() - Date the component started being used in the assembly item. */ + Date the component started being used in the assembly item. + Constraint CK_BillOfMaterials_EndDate affecting columns "enddate", "startdate": (((enddate > startdate) OR (enddate IS NULL))) */ startdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, /** Default: 1.00 - Quantity of the component needed to create the assembly. */ + Quantity of the component needed to create the assembly. + Constraint CK_BillOfMaterials_BOMLevel affecting columns "bomlevel", "productassemblyid", "perassemblyqty": ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) + Constraint CK_BillOfMaterials_PerAssemblyQty affecting columns "perassemblyqty": ((perassemblyqty >= 1.00)) */ perassemblyqty: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala index 6a5a57e929..2d48e3b5b1 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala @@ -36,7 +36,8 @@ case class DocumentRowUnsaved( fileextension: Option[/* max 8 chars */ String], /** Revision number of the document. */ revision: /* bpchar, max 5 chars */ String, - /** 1 = Pending approval, 2 = Approved, 3 = Obsolete */ + /** 1 = Pending approval, 2 = Approved, 3 = Obsolete + Constraint CK_Document_Status affecting columns "status": (((status >= 1) AND (status <= 3))) */ status: TypoShort, /** Document abstract. */ documentsummary: Option[String], diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala index 3a8b8d3936..b6fdb2177a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala @@ -27,10 +27,12 @@ case class LocationRowUnsaved( Primary key for Location records. */ locationid: Defaulted[LocationId] = Defaulted.UseDefault, /** Default: 0.00 - Standard hourly cost of the manufacturing location. */ + Standard hourly cost of the manufacturing location. + Constraint CK_Location_CostRate affecting columns "costrate": ((costrate >= 0.00)) */ costrate: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Work capacity (in hours) of the manufacturing location. */ + Work capacity (in hours) of the manufacturing location. + Constraint CK_Location_Availability affecting columns "availability": ((availability >= 0.00)) */ availability: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala index c541e43f4e..c92ee25075 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala @@ -33,13 +33,17 @@ case class ProductRowUnsaved( productnumber: /* max 25 chars */ String, /** Product color. */ color: Option[/* max 15 chars */ String], - /** Minimum inventory quantity. */ + /** Minimum inventory quantity. + Constraint CK_Product_SafetyStockLevel affecting columns "safetystocklevel": ((safetystocklevel > 0)) */ safetystocklevel: TypoShort, - /** Inventory level that triggers a purchase order or work order. */ + /** Inventory level that triggers a purchase order or work order. + Constraint CK_Product_ReorderPoint affecting columns "reorderpoint": ((reorderpoint > 0)) */ reorderpoint: TypoShort, - /** Standard cost of the product. */ + /** Standard cost of the product. + Constraint CK_Product_StandardCost affecting columns "standardcost": ((standardcost >= 0.00)) */ standardcost: BigDecimal, - /** Selling price. */ + /** Selling price. + Constraint CK_Product_ListPrice affecting columns "listprice": ((listprice >= 0.00)) */ listprice: BigDecimal, /** Product size. */ size: Option[/* max 5 chars */ String], @@ -49,15 +53,20 @@ case class ProductRowUnsaved( /** Unit of measure for Weight column. Points to [[unitmeasure.UnitmeasureRow.unitmeasurecode]] */ weightunitmeasurecode: Option[UnitmeasureId], - /** Product weight. */ + /** Product weight. + Constraint CK_Product_Weight affecting columns "weight": ((weight > 0.00)) */ weight: Option[BigDecimal], - /** Number of days required to manufacture the product. */ + /** Number of days required to manufacture the product. + Constraint CK_Product_DaysToManufacture affecting columns "daystomanufacture": ((daystomanufacture >= 0)) */ daystomanufacture: Int, - /** R = Road, M = Mountain, T = Touring, S = Standard */ + /** R = Road, M = Mountain, T = Touring, S = Standard + Constraint CK_Product_ProductLine affecting columns "productline": (((upper((productline)::text) = ANY (ARRAY['S'::text, 'T'::text, 'M'::text, 'R'::text])) OR (productline IS NULL))) */ productline: Option[/* bpchar, max 2 chars */ String], - /** H = High, M = Medium, L = Low */ + /** H = High, M = Medium, L = Low + Constraint CK_Product_Class affecting columns "class": (((upper((class)::text) = ANY (ARRAY['L'::text, 'M'::text, 'H'::text])) OR (class IS NULL))) */ `class`: Option[/* bpchar, max 2 chars */ String], - /** W = Womens, M = Mens, U = Universal */ + /** W = Womens, M = Mens, U = Universal + Constraint CK_Product_Style affecting columns "style": (((upper((style)::text) = ANY (ARRAY['W'::text, 'M'::text, 'U'::text])) OR (style IS NULL))) */ style: Option[/* bpchar, max 2 chars */ String], /** Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. Points to [[productsubcategory.ProductsubcategoryRow.productsubcategoryid]] */ @@ -65,9 +74,11 @@ case class ProductRowUnsaved( /** Product is a member of this product model. Foreign key to ProductModel.ProductModelID. Points to [[productmodel.ProductmodelRow.productmodelid]] */ productmodelid: Option[ProductmodelId], - /** Date the product was available for sale. */ + /** Date the product was available for sale. + Constraint CK_Product_SellEndDate affecting columns "sellenddate", "sellstartdate": (((sellenddate >= sellstartdate) OR (sellenddate IS NULL))) */ sellstartdate: TypoLocalDateTime, - /** Date the product was no longer available for sale. */ + /** Date the product was no longer available for sale. + Constraint CK_Product_SellEndDate affecting columns "sellenddate", "sellstartdate": (((sellenddate >= sellstartdate) OR (sellenddate IS NULL))) */ sellenddate: Option[TypoLocalDateTime], /** Date the product was discontinued. */ discontinueddate: Option[TypoLocalDateTime], diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala index 4809675367..da456bf62c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala @@ -24,11 +24,14 @@ case class ProductcosthistoryRowUnsaved( /** Product identification number. Foreign key to Product.ProductID Points to [[product.ProductRow.productid]] */ productid: ProductId, - /** Product cost start date. */ + /** Product cost start date. + Constraint CK_ProductCostHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** Product cost end date. */ + /** Product cost end date. + Constraint CK_ProductCostHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], - /** Standard cost of the product. */ + /** Standard cost of the product. + Constraint CK_ProductCostHistory_StandardCost affecting columns "standardcost": ((standardcost >= 0.00)) */ standardcost: BigDecimal, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala index 82daa0f812..786ca90a35 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala @@ -32,7 +32,8 @@ case class ProductinventoryRowUnsaved( locationid: LocationId, /** Storage compartment within an inventory location. */ shelf: /* max 10 chars */ String, - /** Storage container on a shelf in an inventory location. */ + /** Storage container on a shelf in an inventory location. + Constraint CK_ProductInventory_Bin affecting columns "bin": (((bin >= 0) AND (bin <= 100))) */ bin: TypoShort, /** Default: 0 Quantity of products in the inventory location. */ diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala index 168db3217a..e192e3403d 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala @@ -24,11 +24,14 @@ case class ProductlistpricehistoryRowUnsaved( /** Product identification number. Foreign key to Product.ProductID Points to [[product.ProductRow.productid]] */ productid: ProductId, - /** List price start date. */ + /** List price start date. + Constraint CK_ProductListPriceHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** List price end date */ + /** List price end date + Constraint CK_ProductListPriceHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], - /** Product list price. */ + /** Product list price. + Constraint CK_ProductListPriceHistory_ListPrice affecting columns "listprice": ((listprice > 0.00)) */ listprice: BigDecimal, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala index f4ce52677e..e829ec3d24 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala @@ -29,7 +29,8 @@ case class ProductreviewRowUnsaved( reviewername: Name, /** Reviewer's e-mail address. */ emailaddress: /* max 50 chars */ String, - /** Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. */ + /** Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. + Constraint CK_ProductReview_Rating affecting columns "rating": (((rating >= 1) AND (rating <= 5))) */ rating: Int, /** Reviewer's comments */ comments: Option[/* max 3850 chars */ String], diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala index c4d50fe3d7..9cf320e561 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala @@ -26,7 +26,8 @@ case class TransactionhistoryRowUnsaved( productid: ProductId, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder */ + /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder + Constraint CK_TransactionHistory_TransactionType affecting columns "transactiontype": ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ transactiontype: /* bpchar, max 1 chars */ String, /** Product quantity. */ quantity: Int, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala index 653f8f2698..ccc24fef5c 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala @@ -26,7 +26,8 @@ case class TransactionhistoryarchiveRowUnsaved( productid: Int, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** W = Work Order, S = Sales Order, P = Purchase Order */ + /** W = Work Order, S = Sales Order, P = Purchase Order + Constraint CK_TransactionHistoryArchive_TransactionType affecting columns "transactiontype": ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ transactiontype: /* bpchar, max 1 chars */ String, /** Product quantity. */ quantity: Int, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala index cf1142e9e9..dd4c5c7fe4 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala @@ -26,13 +26,17 @@ case class WorkorderRowUnsaved( /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, - /** Product quantity to build. */ + /** Product quantity to build. + Constraint CK_WorkOrder_OrderQty affecting columns "orderqty": ((orderqty > 0)) */ orderqty: Int, - /** Quantity that failed inspection. */ + /** Quantity that failed inspection. + Constraint CK_WorkOrder_ScrappedQty affecting columns "scrappedqty": ((scrappedqty >= 0)) */ scrappedqty: TypoShort, - /** Work order start date. */ + /** Work order start date. + Constraint CK_WorkOrder_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** Work order end date. */ + /** Work order end date. + Constraint CK_WorkOrder_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], /** Work order due date. */ duedate: TypoLocalDateTime, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala index b4d09f35b7..bca66a7b00 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala @@ -33,19 +33,26 @@ case class WorkorderroutingRowUnsaved( /** Manufacturing location where the part is processed. Foreign key to Location.LocationID. Points to [[location.LocationRow.locationid]] */ locationid: LocationId, - /** Planned manufacturing start date. */ + /** Planned manufacturing start date. + Constraint CK_WorkOrderRouting_ScheduledEndDate affecting columns "scheduledenddate", "scheduledstartdate": ((scheduledenddate >= scheduledstartdate)) */ scheduledstartdate: TypoLocalDateTime, - /** Planned manufacturing end date. */ + /** Planned manufacturing end date. + Constraint CK_WorkOrderRouting_ScheduledEndDate affecting columns "scheduledenddate", "scheduledstartdate": ((scheduledenddate >= scheduledstartdate)) */ scheduledenddate: TypoLocalDateTime, - /** Actual start date. */ + /** Actual start date. + Constraint CK_WorkOrderRouting_ActualEndDate affecting columns "actualstartdate", "actualenddate": (((actualenddate >= actualstartdate) OR (actualenddate IS NULL) OR (actualstartdate IS NULL))) */ actualstartdate: Option[TypoLocalDateTime], - /** Actual end date. */ + /** Actual end date. + Constraint CK_WorkOrderRouting_ActualEndDate affecting columns "actualstartdate", "actualenddate": (((actualenddate >= actualstartdate) OR (actualenddate IS NULL) OR (actualstartdate IS NULL))) */ actualenddate: Option[TypoLocalDateTime], - /** Number of manufacturing hours used. */ + /** Number of manufacturing hours used. + Constraint CK_WorkOrderRouting_ActualResourceHrs affecting columns "actualresourcehrs": ((actualresourcehrs >= 0.0000)) */ actualresourcehrs: Option[BigDecimal], - /** Estimated manufacturing cost. */ + /** Estimated manufacturing cost. + Constraint CK_WorkOrderRouting_PlannedCost affecting columns "plannedcost": ((plannedcost > 0.00)) */ plannedcost: BigDecimal, - /** Actual manufacturing cost. */ + /** Actual manufacturing cost. + Constraint CK_WorkOrderRouting_ActualCost affecting columns "actualcost": ((actualcost > 0.00)) */ actualcost: Option[BigDecimal], /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala index 9e05ad96aa..4f6d3941bc 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala @@ -29,19 +29,25 @@ case class ProductvendorRowUnsaved( /** Primary key. Foreign key to Vendor.BusinessEntityID. Points to [[vendor.VendorRow.businessentityid]] */ businessentityid: BusinessentityId, - /** The average span of time (in days) between placing an order with the vendor and receiving the purchased product. */ + /** The average span of time (in days) between placing an order with the vendor and receiving the purchased product. + Constraint CK_ProductVendor_AverageLeadTime affecting columns "averageleadtime": ((averageleadtime >= 1)) */ averageleadtime: Int, - /** The vendor's usual selling price. */ + /** The vendor's usual selling price. + Constraint CK_ProductVendor_StandardPrice affecting columns "standardprice": ((standardprice > 0.00)) */ standardprice: BigDecimal, - /** The selling price when last purchased. */ + /** The selling price when last purchased. + Constraint CK_ProductVendor_LastReceiptCost affecting columns "lastreceiptcost": ((lastreceiptcost > 0.00)) */ lastreceiptcost: Option[BigDecimal], /** Date the product was last received by the vendor. */ lastreceiptdate: Option[TypoLocalDateTime], - /** The maximum quantity that should be ordered. */ + /** The maximum quantity that should be ordered. + Constraint CK_ProductVendor_MinOrderQty affecting columns "minorderqty": ((minorderqty >= 1)) */ minorderqty: Int, - /** The minimum quantity that should be ordered. */ + /** The minimum quantity that should be ordered. + Constraint CK_ProductVendor_MaxOrderQty affecting columns "maxorderqty": ((maxorderqty >= 1)) */ maxorderqty: Int, - /** The quantity currently on order. */ + /** The quantity currently on order. + Constraint CK_ProductVendor_OnOrderQty affecting columns "onorderqty": ((onorderqty >= 0)) */ onorderqty: Option[Int], /** The product's unit of measure. Points to [[production.unitmeasure.UnitmeasureRow.unitmeasurecode]] */ diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala index 9992effc04..3be591a653 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala @@ -28,16 +28,20 @@ case class PurchaseorderdetailRowUnsaved( purchaseorderid: PurchaseorderheaderId, /** Date the product is expected to be received. */ duedate: TypoLocalDateTime, - /** Quantity ordered. */ + /** Quantity ordered. + Constraint CK_PurchaseOrderDetail_OrderQty affecting columns "orderqty": ((orderqty > 0)) */ orderqty: TypoShort, /** Product identification number. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, - /** Vendor's selling price of a single product. */ + /** Vendor's selling price of a single product. + Constraint CK_PurchaseOrderDetail_UnitPrice affecting columns "unitprice": ((unitprice >= 0.00)) */ unitprice: BigDecimal, - /** Quantity actually received from the vendor. */ + /** Quantity actually received from the vendor. + Constraint CK_PurchaseOrderDetail_ReceivedQty affecting columns "receivedqty": ((receivedqty >= 0.00)) */ receivedqty: BigDecimal, - /** Quantity rejected during inspection. */ + /** Quantity rejected during inspection. + Constraint CK_PurchaseOrderDetail_RejectedQty affecting columns "rejectedqty": ((rejectedqty >= 0.00)) */ rejectedqty: BigDecimal, /** Default: nextval('purchasing.purchaseorderdetail_purchaseorderdetailid_seq'::regclass) Primary key. One line number per purchased product. */ diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala index adb1af6a05..edec28ad5b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala @@ -32,7 +32,8 @@ case class PurchaseorderheaderRowUnsaved( /** Shipping method. Foreign key to ShipMethod.ShipMethodID. Points to [[shipmethod.ShipmethodRow.shipmethodid]] */ shipmethodid: ShipmethodId, - /** Estimated shipment date from the vendor. */ + /** Estimated shipment date from the vendor. + Constraint CK_PurchaseOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Default: nextval('purchasing.purchaseorderheader_purchaseorderid_seq'::regclass) Primary key. */ @@ -41,19 +42,24 @@ case class PurchaseorderheaderRowUnsaved( Incremental number to track changes to the purchase order over time. */ revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: 1 - Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete */ + Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete + Constraint CK_PurchaseOrderHeader_Status affecting columns "status": (((status >= 1) AND (status <= 4))) */ status: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: now() - Purchase order creation date. */ + Purchase order creation date. + Constraint CK_PurchaseOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, /** Default: 0.00 - Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. */ + Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. + Constraint CK_PurchaseOrderHeader_SubTotal affecting columns "subtotal": ((subtotal >= 0.00)) */ subtotal: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Tax amount. */ + Tax amount. + Constraint CK_PurchaseOrderHeader_TaxAmt affecting columns "taxamt": ((taxamt >= 0.00)) */ taxamt: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Shipping cost. */ + Shipping cost. + Constraint CK_PurchaseOrderHeader_Freight affecting columns "freight": ((freight >= 0.00)) */ freight: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala index 10f7e4cb92..7378573fe6 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala @@ -28,10 +28,12 @@ case class ShipmethodRowUnsaved( Primary key for ShipMethod records. */ shipmethodid: Defaulted[ShipmethodId] = Defaulted.UseDefault, /** Default: 0.00 - Minimum shipping charge. */ + Minimum shipping charge. + Constraint CK_ShipMethod_ShipBase affecting columns "shipbase": ((shipbase > 0.00)) */ shipbase: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Shipping charge per pound. */ + Shipping charge per pound. + Constraint CK_ShipMethod_ShipRate affecting columns "shiprate": ((shiprate > 0.00)) */ shiprate: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala index 07c10966d4..21e62ea89e 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala @@ -32,7 +32,8 @@ case class VendorRowUnsaved( accountnumber: AccountNumber, /** Company name. */ name: Name, - /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average */ + /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average + Constraint CK_Vendor_CreditRating affecting columns "creditrating": (((creditrating >= 1) AND (creditrating <= 5))) */ creditrating: TypoShort, /** Vendor URL. */ purchasingwebserviceurl: Option[/* max 1024 chars */ String], diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala index 5f91505c55..a1f8baaeec 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala @@ -30,7 +30,8 @@ case class SalesorderdetailRowUnsaved( salesorderid: SalesorderheaderId, /** Shipment tracking number supplied by the shipper. */ carriertrackingnumber: Option[/* max 25 chars */ String], - /** Quantity ordered per product. */ + /** Quantity ordered per product. + Constraint CK_SalesOrderDetail_OrderQty affecting columns "orderqty": ((orderqty > 0)) */ orderqty: TypoShort, /** Product sold to customer. Foreign key to Product.ProductID. Points to [[specialofferproduct.SpecialofferproductRow.productid]] */ @@ -38,13 +39,15 @@ case class SalesorderdetailRowUnsaved( /** Promotional code. Foreign key to SpecialOffer.SpecialOfferID. Points to [[specialofferproduct.SpecialofferproductRow.specialofferid]] */ specialofferid: SpecialofferId, - /** Selling price of a single product. */ + /** Selling price of a single product. + Constraint CK_SalesOrderDetail_UnitPrice affecting columns "unitprice": ((unitprice >= 0.00)) */ unitprice: BigDecimal, /** Default: nextval('sales.salesorderdetail_salesorderdetailid_seq'::regclass) Primary key. One incremental unique number per product sold. */ salesorderdetailid: Defaulted[Int] = Defaulted.UseDefault, /** Default: 0.0 - Discount amount. */ + Discount amount. + Constraint CK_SalesOrderDetail_UnitPriceDiscount affecting columns "unitpricediscount": ((unitpricediscount >= 0.00)) */ unitpricediscount: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala index 5a1fc80f17..c2ac52cce1 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala @@ -32,9 +32,11 @@ import scala.util.Try /** This class corresponds to a row in table `sales.salesorderheader` which has not been persisted yet */ case class SalesorderheaderRowUnsaved( - /** Date the order is due to the customer. */ + /** Date the order is due to the customer. + Constraint CK_SalesOrderHeader_DueDate affecting columns "orderdate", "duedate": ((duedate >= orderdate)) */ duedate: TypoLocalDateTime, - /** Date the order was shipped to the customer. */ + /** Date the order was shipped to the customer. + Constraint CK_SalesOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Customer purchase order number reference. */ purchaseordernumber: Option[OrderNumber], @@ -77,22 +79,28 @@ case class SalesorderheaderRowUnsaved( Incremental number to track changes to the sales order over time. */ revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: now() - Dates the sales order was created. */ + Dates the sales order was created. + Constraint CK_SalesOrderHeader_DueDate affecting columns "orderdate", "duedate": ((duedate >= orderdate)) + Constraint CK_SalesOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, /** Default: 1 - Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled */ + Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled + Constraint CK_SalesOrderHeader_Status affecting columns "status": (((status >= 0) AND (status <= 8))) */ status: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: true 0 = Order placed by sales person. 1 = Order placed online by customer. */ onlineorderflag: Defaulted[Flag] = Defaulted.UseDefault, /** Default: 0.00 - Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. */ + Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. + Constraint CK_SalesOrderHeader_SubTotal affecting columns "subtotal": ((subtotal >= 0.00)) */ subtotal: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Tax amount. */ + Tax amount. + Constraint CK_SalesOrderHeader_TaxAmt affecting columns "taxamt": ((taxamt >= 0.00)) */ taxamt: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Shipping cost. */ + Shipping cost. + Constraint CK_SalesOrderHeader_Freight affecting columns "freight": ((freight >= 0.00)) */ freight: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala index b5a6961299..b3f0f0a745 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala @@ -29,19 +29,24 @@ case class SalespersonRowUnsaved( /** Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: Option[SalesterritoryId], - /** Projected yearly sales. */ + /** Projected yearly sales. + Constraint CK_SalesPerson_SalesQuota affecting columns "salesquota": ((salesquota > 0.00)) */ salesquota: Option[BigDecimal], /** Default: 0.00 - Bonus due if quota is met. */ + Bonus due if quota is met. + Constraint CK_SalesPerson_Bonus affecting columns "bonus": ((bonus >= 0.00)) */ bonus: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Commision percent received per sale. */ + Commision percent received per sale. + Constraint CK_SalesPerson_CommissionPct affecting columns "commissionpct": ((commissionpct >= 0.00)) */ commissionpct: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Sales total year to date. */ + Sales total year to date. + Constraint CK_SalesPerson_SalesYTD affecting columns "salesytd": ((salesytd >= 0.00)) */ salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Sales total of previous year. */ + Sales total of previous year. + Constraint CK_SalesPerson_SalesLastYear affecting columns "saleslastyear": ((saleslastyear >= 0.00)) */ saleslastyear: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala index 1d4d6f692b..1253be412f 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala @@ -27,7 +27,8 @@ case class SalespersonquotahistoryRowUnsaved( businessentityid: BusinessentityId, /** Sales quota date. */ quotadate: TypoLocalDateTime, - /** Sales quota amount. */ + /** Sales quota amount. + Constraint CK_SalesPersonQuotaHistory_SalesQuota affecting columns "salesquota": ((salesquota > 0.00)) */ salesquota: BigDecimal, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala index b2f12f52ec..46a6709d97 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala @@ -27,7 +27,8 @@ case class SalestaxrateRowUnsaved( /** State, province, or country/region the sales tax applies to. Points to [[person.stateprovince.StateprovinceRow.stateprovinceid]] */ stateprovinceid: StateprovinceId, - /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. */ + /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. + Constraint CK_SalesTaxRate_TaxType affecting columns "taxtype": (((taxtype >= 1) AND (taxtype <= 3))) */ taxtype: TypoShort, /** Tax rate description. */ name: Name, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala index 39865a9f7c..b403265695 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala @@ -34,16 +34,20 @@ case class SalesterritoryRowUnsaved( Primary key for SalesTerritory records. */ territoryid: Defaulted[SalesterritoryId] = Defaulted.UseDefault, /** Default: 0.00 - Sales in the territory year to date. */ + Sales in the territory year to date. + Constraint CK_SalesTerritory_SalesYTD affecting columns "salesytd": ((salesytd >= 0.00)) */ salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Sales in the territory the previous year. */ + Sales in the territory the previous year. + Constraint CK_SalesTerritory_SalesLastYear affecting columns "saleslastyear": ((saleslastyear >= 0.00)) */ saleslastyear: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Business costs in the territory year to date. */ + Business costs in the territory year to date. + Constraint CK_SalesTerritory_CostYTD affecting columns "costytd": ((costytd >= 0.00)) */ costytd: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Business costs in the territory the previous year. */ + Business costs in the territory the previous year. + Constraint CK_SalesTerritory_CostLastYear affecting columns "costlastyear": ((costlastyear >= 0.00)) */ costlastyear: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala index eae2bfb6f3..3a3c880ad9 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala @@ -29,9 +29,11 @@ case class SalesterritoryhistoryRowUnsaved( /** Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: SalesterritoryId, - /** Primary key. Date the sales representive started work in the territory. */ + /** Primary key. Date the sales representive started work in the territory. + Constraint CK_SalesTerritoryHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** Date the sales representative left work in the territory. */ + /** Date the sales representative left work in the territory. + Constraint CK_SalesTerritoryHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala index b80271e313..a467d9f79b 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala @@ -30,7 +30,8 @@ case class ShoppingcartitemRowUnsaved( Primary key for ShoppingCartItem records. */ shoppingcartitemid: Defaulted[ShoppingcartitemId] = Defaulted.UseDefault, /** Default: 1 - Product quantity ordered. */ + Product quantity ordered. + Constraint CK_ShoppingCartItem_Quantity affecting columns "quantity": ((quantity >= 1)) */ quantity: Defaulted[Int] = Defaulted.UseDefault, /** Default: now() Date the time the record was created. */ diff --git a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala index c4f91eff99..b27426a16a 100644 --- a/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala +++ b/typo-tester-anorm/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala @@ -27,20 +27,25 @@ case class SpecialofferRowUnsaved( `type`: /* max 50 chars */ String, /** Group the discount applies to such as Reseller or Customer. */ category: /* max 50 chars */ String, - /** Discount start date. */ + /** Discount start date. + Constraint CK_SpecialOffer_EndDate affecting columns "startdate", "enddate": ((enddate >= startdate)) */ startdate: TypoLocalDateTime, - /** Discount end date. */ + /** Discount end date. + Constraint CK_SpecialOffer_EndDate affecting columns "startdate", "enddate": ((enddate >= startdate)) */ enddate: TypoLocalDateTime, - /** Maximum discount percent allowed. */ + /** Maximum discount percent allowed. + Constraint CK_SpecialOffer_MaxQty affecting columns "maxqty": ((maxqty >= 0)) */ maxqty: Option[Int], /** Default: nextval('sales.specialoffer_specialofferid_seq'::regclass) Primary key for SpecialOffer records. */ specialofferid: Defaulted[SpecialofferId] = Defaulted.UseDefault, /** Default: 0.00 - Discount precentage. */ + Discount precentage. + Constraint CK_SpecialOffer_DiscountPct affecting columns "discountpct": ((discountpct >= 0.00)) */ discountpct: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0 - Minimum discount percent allowed. */ + Minimum discount percent allowed. + Constraint CK_SpecialOffer_MinQty affecting columns "minqty": ((minqty >= 0)) */ minqty: Defaulted[Int] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala index 4e55799328..e86052df12 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employee/EmployeeRowUnsaved.scala @@ -28,22 +28,28 @@ case class EmployeeRowUnsaved( loginid: /* max 256 chars */ String, /** Work title such as Buyer or Sales Representative. */ jobtitle: /* max 50 chars */ String, - /** Date of birth. */ + /** Date of birth. + Constraint CK_Employee_BirthDate affecting columns "birthdate": (((birthdate >= '1930-01-01'::date) AND (birthdate <= (now() - '18 years'::interval)))) */ birthdate: TypoLocalDate, - /** M = Married, S = Single */ + /** M = Married, S = Single + Constraint CK_Employee_MaritalStatus affecting columns "maritalstatus": ((upper((maritalstatus)::text) = ANY (ARRAY['M'::text, 'S'::text]))) */ maritalstatus: /* bpchar, max 1 chars */ String, - /** M = Male, F = Female */ + /** M = Male, F = Female + Constraint CK_Employee_Gender affecting columns "gender": ((upper((gender)::text) = ANY (ARRAY['M'::text, 'F'::text]))) */ gender: /* bpchar, max 1 chars */ String, - /** Employee hired on this date. */ + /** Employee hired on this date. + Constraint CK_Employee_HireDate affecting columns "hiredate": (((hiredate >= '1996-07-01'::date) AND (hiredate <= (now() + '1 day'::interval)))) */ hiredate: TypoLocalDate, /** Default: true Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. */ salariedflag: Defaulted[Flag] = Defaulted.UseDefault, /** Default: 0 - Number of available vacation hours. */ + Number of available vacation hours. + Constraint CK_Employee_VacationHours affecting columns "vacationhours": (((vacationhours >= '-40'::integer) AND (vacationhours <= 240))) */ vacationhours: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: 0 - Number of available sick leave hours. */ + Number of available sick leave hours. + Constraint CK_Employee_SickLeaveHours affecting columns "sickleavehours": (((sickleavehours >= 0) AND (sickleavehours <= 120))) */ sickleavehours: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: true 0 = Inactive, 1 = Active */ diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala index 93bdca1687..9ac3eebebb 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeedepartmenthistory/EmployeedepartmenthistoryRowUnsaved.scala @@ -27,9 +27,11 @@ case class EmployeedepartmenthistoryRowUnsaved( /** Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. Points to [[shift.ShiftRow.shiftid]] */ shiftid: ShiftId, - /** Date the employee started work in the department. */ + /** Date the employee started work in the department. + Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDate, - /** Date the employee left the department. NULL = Current department. */ + /** Date the employee left the department. NULL = Current department. + Constraint CK_EmployeeDepartmentHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDate], /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala index b2f68fb9d8..0c39f322fe 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/humanresources/employeepayhistory/EmployeepayhistoryRowUnsaved.scala @@ -21,9 +21,11 @@ case class EmployeepayhistoryRowUnsaved( businessentityid: BusinessentityId, /** Date the change in pay is effective */ ratechangedate: TypoLocalDateTime, - /** Salary hourly rate. */ + /** Salary hourly rate. + Constraint CK_EmployeePayHistory_Rate affecting columns "rate": (((rate >= 6.50) AND (rate <= 200.00))) */ rate: BigDecimal, - /** 1 = Salary received monthly, 2 = Salary received biweekly */ + /** 1 = Salary received monthly, 2 = Salary received biweekly + Constraint CK_EmployeePayHistory_PayFrequency affecting columns "payfrequency": ((payfrequency = ANY (ARRAY[1, 2]))) */ payfrequency: TypoShort, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala index f83b7a5512..9e8a67b00d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/person/person/PersonRowUnsaved.scala @@ -23,7 +23,8 @@ case class PersonRowUnsaved( /** Primary key for Person records. Points to [[businessentity.BusinessentityRow.businessentityid]] */ businessentityid: BusinessentityId, - /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact */ + /** Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact + Constraint CK_Person_PersonType affecting columns "persontype": (((persontype IS NULL) OR (upper((persontype)::text) = ANY (ARRAY['SC'::text, 'VC'::text, 'IN'::text, 'EM'::text, 'SP'::text, 'GC'::text])))) */ persontype: /* bpchar, max 2 chars */ String, /** A courtesy title. For example, Mr. or Ms. */ title: Option[/* max 8 chars */ String], @@ -43,7 +44,8 @@ case class PersonRowUnsaved( 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. */ namestyle: Defaulted[NameStyle] = Defaulted.UseDefault, /** Default: 0 - 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. */ + 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. + Constraint CK_Person_EmailPromotion affecting columns "emailpromotion": (((emailpromotion >= 0) AND (emailpromotion <= 2))) */ emailpromotion: Defaulted[Int] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala index 61d68a505e..7dfe044078 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/billofmaterials/BillofmaterialsRowUnsaved.scala @@ -18,26 +18,34 @@ import io.circe.Encoder /** This class corresponds to a row in table `production.billofmaterials` which has not been persisted yet */ case class BillofmaterialsRowUnsaved( /** Parent product identification number. Foreign key to Product.ProductID. - Points to [[product.ProductRow.productid]] */ + Points to [[product.ProductRow.productid]] + Constraint CK_BillOfMaterials_BOMLevel affecting columns "bomlevel", "productassemblyid", "perassemblyqty": ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) + Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns "productassemblyid", "componentid": ((productassemblyid <> componentid)) */ productassemblyid: Option[ProductId], /** Component identification number. Foreign key to Product.ProductID. - Points to [[product.ProductRow.productid]] */ + Points to [[product.ProductRow.productid]] + Constraint CK_BillOfMaterials_ProductAssemblyID affecting columns "productassemblyid", "componentid": ((productassemblyid <> componentid)) */ componentid: ProductId, - /** Date the component stopped being used in the assembly item. */ + /** Date the component stopped being used in the assembly item. + Constraint CK_BillOfMaterials_EndDate affecting columns "enddate", "startdate": (((enddate > startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], /** Standard code identifying the unit of measure for the quantity. Points to [[unitmeasure.UnitmeasureRow.unitmeasurecode]] */ unitmeasurecode: UnitmeasureId, - /** Indicates the depth the component is from its parent (AssemblyID). */ + /** Indicates the depth the component is from its parent (AssemblyID). + Constraint CK_BillOfMaterials_BOMLevel affecting columns "bomlevel", "productassemblyid", "perassemblyqty": ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) */ bomlevel: TypoShort, /** Default: nextval('production.billofmaterials_billofmaterialsid_seq'::regclass) Primary key for BillOfMaterials records. */ billofmaterialsid: Defaulted[BillofmaterialsId] = Defaulted.UseDefault, /** Default: now() - Date the component started being used in the assembly item. */ + Date the component started being used in the assembly item. + Constraint CK_BillOfMaterials_EndDate affecting columns "enddate", "startdate": (((enddate > startdate) OR (enddate IS NULL))) */ startdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, /** Default: 1.00 - Quantity of the component needed to create the assembly. */ + Quantity of the component needed to create the assembly. + Constraint CK_BillOfMaterials_BOMLevel affecting columns "bomlevel", "productassemblyid", "perassemblyqty": ((((productassemblyid IS NULL) AND (bomlevel = 0) AND (perassemblyqty = 1.00)) OR ((productassemblyid IS NOT NULL) AND (bomlevel >= 1)))) + Constraint CK_BillOfMaterials_PerAssemblyQty affecting columns "perassemblyqty": ((perassemblyqty >= 1.00)) */ perassemblyqty: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala index f284536070..4aba1a68b7 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/document/DocumentRowUnsaved.scala @@ -30,7 +30,8 @@ case class DocumentRowUnsaved( fileextension: Option[/* max 8 chars */ String], /** Revision number of the document. */ revision: /* bpchar, max 5 chars */ String, - /** 1 = Pending approval, 2 = Approved, 3 = Obsolete */ + /** 1 = Pending approval, 2 = Approved, 3 = Obsolete + Constraint CK_Document_Status affecting columns "status": (((status >= 1) AND (status <= 3))) */ status: TypoShort, /** Document abstract. */ documentsummary: Option[String], diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala index a3264b957a..43f88194a3 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/location/LocationRowUnsaved.scala @@ -21,10 +21,12 @@ case class LocationRowUnsaved( Primary key for Location records. */ locationid: Defaulted[LocationId] = Defaulted.UseDefault, /** Default: 0.00 - Standard hourly cost of the manufacturing location. */ + Standard hourly cost of the manufacturing location. + Constraint CK_Location_CostRate affecting columns "costrate": ((costrate >= 0.00)) */ costrate: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Work capacity (in hours) of the manufacturing location. */ + Work capacity (in hours) of the manufacturing location. + Constraint CK_Location_Availability affecting columns "availability": ((availability >= 0.00)) */ availability: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala index c3ce31559c..07d108101b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/product/ProductRowUnsaved.scala @@ -31,13 +31,17 @@ case class ProductRowUnsaved( productnumber: /* max 25 chars */ String, /** Product color. */ color: Option[/* max 15 chars */ String], - /** Minimum inventory quantity. */ + /** Minimum inventory quantity. + Constraint CK_Product_SafetyStockLevel affecting columns "safetystocklevel": ((safetystocklevel > 0)) */ safetystocklevel: TypoShort, - /** Inventory level that triggers a purchase order or work order. */ + /** Inventory level that triggers a purchase order or work order. + Constraint CK_Product_ReorderPoint affecting columns "reorderpoint": ((reorderpoint > 0)) */ reorderpoint: TypoShort, - /** Standard cost of the product. */ + /** Standard cost of the product. + Constraint CK_Product_StandardCost affecting columns "standardcost": ((standardcost >= 0.00)) */ standardcost: BigDecimal, - /** Selling price. */ + /** Selling price. + Constraint CK_Product_ListPrice affecting columns "listprice": ((listprice >= 0.00)) */ listprice: BigDecimal, /** Product size. */ size: Option[/* max 5 chars */ String], @@ -47,15 +51,20 @@ case class ProductRowUnsaved( /** Unit of measure for Weight column. Points to [[unitmeasure.UnitmeasureRow.unitmeasurecode]] */ weightunitmeasurecode: Option[UnitmeasureId], - /** Product weight. */ + /** Product weight. + Constraint CK_Product_Weight affecting columns "weight": ((weight > 0.00)) */ weight: Option[BigDecimal], - /** Number of days required to manufacture the product. */ + /** Number of days required to manufacture the product. + Constraint CK_Product_DaysToManufacture affecting columns "daystomanufacture": ((daystomanufacture >= 0)) */ daystomanufacture: Int, - /** R = Road, M = Mountain, T = Touring, S = Standard */ + /** R = Road, M = Mountain, T = Touring, S = Standard + Constraint CK_Product_ProductLine affecting columns "productline": (((upper((productline)::text) = ANY (ARRAY['S'::text, 'T'::text, 'M'::text, 'R'::text])) OR (productline IS NULL))) */ productline: Option[/* bpchar, max 2 chars */ String], - /** H = High, M = Medium, L = Low */ + /** H = High, M = Medium, L = Low + Constraint CK_Product_Class affecting columns "class": (((upper((class)::text) = ANY (ARRAY['L'::text, 'M'::text, 'H'::text])) OR (class IS NULL))) */ `class`: Option[/* bpchar, max 2 chars */ String], - /** W = Womens, M = Mens, U = Universal */ + /** W = Womens, M = Mens, U = Universal + Constraint CK_Product_Style affecting columns "style": (((upper((style)::text) = ANY (ARRAY['W'::text, 'M'::text, 'U'::text])) OR (style IS NULL))) */ style: Option[/* bpchar, max 2 chars */ String], /** Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. Points to [[productsubcategory.ProductsubcategoryRow.productsubcategoryid]] */ @@ -63,9 +72,11 @@ case class ProductRowUnsaved( /** Product is a member of this product model. Foreign key to ProductModel.ProductModelID. Points to [[productmodel.ProductmodelRow.productmodelid]] */ productmodelid: Option[ProductmodelId], - /** Date the product was available for sale. */ + /** Date the product was available for sale. + Constraint CK_Product_SellEndDate affecting columns "sellenddate", "sellstartdate": (((sellenddate >= sellstartdate) OR (sellenddate IS NULL))) */ sellstartdate: TypoLocalDateTime, - /** Date the product was no longer available for sale. */ + /** Date the product was no longer available for sale. + Constraint CK_Product_SellEndDate affecting columns "sellenddate", "sellstartdate": (((sellenddate >= sellstartdate) OR (sellenddate IS NULL))) */ sellenddate: Option[TypoLocalDateTime], /** Date the product was discontinued. */ discontinueddate: Option[TypoLocalDateTime], diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala index 8b1a2eaf0e..e4dcafd867 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productcosthistory/ProductcosthistoryRowUnsaved.scala @@ -18,11 +18,14 @@ case class ProductcosthistoryRowUnsaved( /** Product identification number. Foreign key to Product.ProductID Points to [[product.ProductRow.productid]] */ productid: ProductId, - /** Product cost start date. */ + /** Product cost start date. + Constraint CK_ProductCostHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** Product cost end date. */ + /** Product cost end date. + Constraint CK_ProductCostHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], - /** Standard cost of the product. */ + /** Standard cost of the product. + Constraint CK_ProductCostHistory_StandardCost affecting columns "standardcost": ((standardcost >= 0.00)) */ standardcost: BigDecimal, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala index e764923d38..56776d439d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productinventory/ProductinventoryRowUnsaved.scala @@ -26,7 +26,8 @@ case class ProductinventoryRowUnsaved( locationid: LocationId, /** Storage compartment within an inventory location. */ shelf: /* max 10 chars */ String, - /** Storage container on a shelf in an inventory location. */ + /** Storage container on a shelf in an inventory location. + Constraint CK_ProductInventory_Bin affecting columns "bin": (((bin >= 0) AND (bin <= 100))) */ bin: TypoShort, /** Default: 0 Quantity of products in the inventory location. */ diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala index 1cf11d3cc9..73e4ffe640 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productlistpricehistory/ProductlistpricehistoryRowUnsaved.scala @@ -18,11 +18,14 @@ case class ProductlistpricehistoryRowUnsaved( /** Product identification number. Foreign key to Product.ProductID Points to [[product.ProductRow.productid]] */ productid: ProductId, - /** List price start date. */ + /** List price start date. + Constraint CK_ProductListPriceHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** List price end date */ + /** List price end date + Constraint CK_ProductListPriceHistory_EndDate affecting columns "enddate", "startdate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], - /** Product list price. */ + /** Product list price. + Constraint CK_ProductListPriceHistory_ListPrice affecting columns "listprice": ((listprice > 0.00)) */ listprice: BigDecimal, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala index ac4c70386d..9a5eb14dd7 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/productreview/ProductreviewRowUnsaved.scala @@ -23,7 +23,8 @@ case class ProductreviewRowUnsaved( reviewername: Name, /** Reviewer's e-mail address. */ emailaddress: /* max 50 chars */ String, - /** Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. */ + /** Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. + Constraint CK_ProductReview_Rating affecting columns "rating": (((rating >= 1) AND (rating <= 5))) */ rating: Int, /** Reviewer's comments */ comments: Option[/* max 3850 chars */ String], diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala index a1332d830e..48be176edd 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistory/TransactionhistoryRowUnsaved.scala @@ -20,7 +20,8 @@ case class TransactionhistoryRowUnsaved( productid: ProductId, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder */ + /** W = WorkOrder, S = SalesOrder, P = PurchaseOrder + Constraint CK_TransactionHistory_TransactionType affecting columns "transactiontype": ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ transactiontype: /* bpchar, max 1 chars */ String, /** Product quantity. */ quantity: Int, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala index d8be1b957a..3d9feacf00 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/transactionhistoryarchive/TransactionhistoryarchiveRowUnsaved.scala @@ -20,7 +20,8 @@ case class TransactionhistoryarchiveRowUnsaved( productid: Int, /** Purchase order, sales order, or work order identification number. */ referenceorderid: Int, - /** W = Work Order, S = Sales Order, P = Purchase Order */ + /** W = Work Order, S = Sales Order, P = Purchase Order + Constraint CK_TransactionHistoryArchive_TransactionType affecting columns "transactiontype": ((upper((transactiontype)::text) = ANY (ARRAY['W'::text, 'S'::text, 'P'::text]))) */ transactiontype: /* bpchar, max 1 chars */ String, /** Product quantity. */ quantity: Int, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala index 8f8f2c01a2..ce1d123737 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorder/WorkorderRowUnsaved.scala @@ -20,13 +20,17 @@ case class WorkorderRowUnsaved( /** Product identification number. Foreign key to Product.ProductID. Points to [[product.ProductRow.productid]] */ productid: ProductId, - /** Product quantity to build. */ + /** Product quantity to build. + Constraint CK_WorkOrder_OrderQty affecting columns "orderqty": ((orderqty > 0)) */ orderqty: Int, - /** Quantity that failed inspection. */ + /** Quantity that failed inspection. + Constraint CK_WorkOrder_ScrappedQty affecting columns "scrappedqty": ((scrappedqty >= 0)) */ scrappedqty: TypoShort, - /** Work order start date. */ + /** Work order start date. + Constraint CK_WorkOrder_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** Work order end date. */ + /** Work order end date. + Constraint CK_WorkOrder_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], /** Work order due date. */ duedate: TypoLocalDateTime, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala index 58aac4bfe8..288d554d8d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/production/workorderrouting/WorkorderroutingRowUnsaved.scala @@ -27,19 +27,26 @@ case class WorkorderroutingRowUnsaved( /** Manufacturing location where the part is processed. Foreign key to Location.LocationID. Points to [[location.LocationRow.locationid]] */ locationid: LocationId, - /** Planned manufacturing start date. */ + /** Planned manufacturing start date. + Constraint CK_WorkOrderRouting_ScheduledEndDate affecting columns "scheduledenddate", "scheduledstartdate": ((scheduledenddate >= scheduledstartdate)) */ scheduledstartdate: TypoLocalDateTime, - /** Planned manufacturing end date. */ + /** Planned manufacturing end date. + Constraint CK_WorkOrderRouting_ScheduledEndDate affecting columns "scheduledenddate", "scheduledstartdate": ((scheduledenddate >= scheduledstartdate)) */ scheduledenddate: TypoLocalDateTime, - /** Actual start date. */ + /** Actual start date. + Constraint CK_WorkOrderRouting_ActualEndDate affecting columns "actualstartdate", "actualenddate": (((actualenddate >= actualstartdate) OR (actualenddate IS NULL) OR (actualstartdate IS NULL))) */ actualstartdate: Option[TypoLocalDateTime], - /** Actual end date. */ + /** Actual end date. + Constraint CK_WorkOrderRouting_ActualEndDate affecting columns "actualstartdate", "actualenddate": (((actualenddate >= actualstartdate) OR (actualenddate IS NULL) OR (actualstartdate IS NULL))) */ actualenddate: Option[TypoLocalDateTime], - /** Number of manufacturing hours used. */ + /** Number of manufacturing hours used. + Constraint CK_WorkOrderRouting_ActualResourceHrs affecting columns "actualresourcehrs": ((actualresourcehrs >= 0.0000)) */ actualresourcehrs: Option[BigDecimal], - /** Estimated manufacturing cost. */ + /** Estimated manufacturing cost. + Constraint CK_WorkOrderRouting_PlannedCost affecting columns "plannedcost": ((plannedcost > 0.00)) */ plannedcost: BigDecimal, - /** Actual manufacturing cost. */ + /** Actual manufacturing cost. + Constraint CK_WorkOrderRouting_ActualCost affecting columns "actualcost": ((actualcost > 0.00)) */ actualcost: Option[BigDecimal], /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala index 0b6be4ce04..825318ee1a 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/productvendor/ProductvendorRowUnsaved.scala @@ -23,19 +23,25 @@ case class ProductvendorRowUnsaved( /** Primary key. Foreign key to Vendor.BusinessEntityID. Points to [[vendor.VendorRow.businessentityid]] */ businessentityid: BusinessentityId, - /** The average span of time (in days) between placing an order with the vendor and receiving the purchased product. */ + /** The average span of time (in days) between placing an order with the vendor and receiving the purchased product. + Constraint CK_ProductVendor_AverageLeadTime affecting columns "averageleadtime": ((averageleadtime >= 1)) */ averageleadtime: Int, - /** The vendor's usual selling price. */ + /** The vendor's usual selling price. + Constraint CK_ProductVendor_StandardPrice affecting columns "standardprice": ((standardprice > 0.00)) */ standardprice: BigDecimal, - /** The selling price when last purchased. */ + /** The selling price when last purchased. + Constraint CK_ProductVendor_LastReceiptCost affecting columns "lastreceiptcost": ((lastreceiptcost > 0.00)) */ lastreceiptcost: Option[BigDecimal], /** Date the product was last received by the vendor. */ lastreceiptdate: Option[TypoLocalDateTime], - /** The maximum quantity that should be ordered. */ + /** The maximum quantity that should be ordered. + Constraint CK_ProductVendor_MinOrderQty affecting columns "minorderqty": ((minorderqty >= 1)) */ minorderqty: Int, - /** The minimum quantity that should be ordered. */ + /** The minimum quantity that should be ordered. + Constraint CK_ProductVendor_MaxOrderQty affecting columns "maxorderqty": ((maxorderqty >= 1)) */ maxorderqty: Int, - /** The quantity currently on order. */ + /** The quantity currently on order. + Constraint CK_ProductVendor_OnOrderQty affecting columns "onorderqty": ((onorderqty >= 0)) */ onorderqty: Option[Int], /** The product's unit of measure. Points to [[production.unitmeasure.UnitmeasureRow.unitmeasurecode]] */ diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala index ce38b5ce9b..83a64eacd2 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderdetail/PurchaseorderdetailRowUnsaved.scala @@ -22,16 +22,20 @@ case class PurchaseorderdetailRowUnsaved( purchaseorderid: PurchaseorderheaderId, /** Date the product is expected to be received. */ duedate: TypoLocalDateTime, - /** Quantity ordered. */ + /** Quantity ordered. + Constraint CK_PurchaseOrderDetail_OrderQty affecting columns "orderqty": ((orderqty > 0)) */ orderqty: TypoShort, /** Product identification number. Foreign key to Product.ProductID. Points to [[production.product.ProductRow.productid]] */ productid: ProductId, - /** Vendor's selling price of a single product. */ + /** Vendor's selling price of a single product. + Constraint CK_PurchaseOrderDetail_UnitPrice affecting columns "unitprice": ((unitprice >= 0.00)) */ unitprice: BigDecimal, - /** Quantity actually received from the vendor. */ + /** Quantity actually received from the vendor. + Constraint CK_PurchaseOrderDetail_ReceivedQty affecting columns "receivedqty": ((receivedqty >= 0.00)) */ receivedqty: BigDecimal, - /** Quantity rejected during inspection. */ + /** Quantity rejected during inspection. + Constraint CK_PurchaseOrderDetail_RejectedQty affecting columns "rejectedqty": ((rejectedqty >= 0.00)) */ rejectedqty: BigDecimal, /** Default: nextval('purchasing.purchaseorderdetail_purchaseorderdetailid_seq'::regclass) Primary key. One line number per purchased product. */ diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala index a0efa2f218..9aaff986b1 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/purchaseorderheader/PurchaseorderheaderRowUnsaved.scala @@ -26,7 +26,8 @@ case class PurchaseorderheaderRowUnsaved( /** Shipping method. Foreign key to ShipMethod.ShipMethodID. Points to [[shipmethod.ShipmethodRow.shipmethodid]] */ shipmethodid: ShipmethodId, - /** Estimated shipment date from the vendor. */ + /** Estimated shipment date from the vendor. + Constraint CK_PurchaseOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Default: nextval('purchasing.purchaseorderheader_purchaseorderid_seq'::regclass) Primary key. */ @@ -35,19 +36,24 @@ case class PurchaseorderheaderRowUnsaved( Incremental number to track changes to the purchase order over time. */ revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: 1 - Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete */ + Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete + Constraint CK_PurchaseOrderHeader_Status affecting columns "status": (((status >= 1) AND (status <= 4))) */ status: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: now() - Purchase order creation date. */ + Purchase order creation date. + Constraint CK_PurchaseOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, /** Default: 0.00 - Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. */ + Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. + Constraint CK_PurchaseOrderHeader_SubTotal affecting columns "subtotal": ((subtotal >= 0.00)) */ subtotal: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Tax amount. */ + Tax amount. + Constraint CK_PurchaseOrderHeader_TaxAmt affecting columns "taxamt": ((taxamt >= 0.00)) */ taxamt: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Shipping cost. */ + Shipping cost. + Constraint CK_PurchaseOrderHeader_Freight affecting columns "freight": ((freight >= 0.00)) */ freight: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: now() */ modifieddate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala index f1aea9e181..3fe23e1a3f 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/shipmethod/ShipmethodRowUnsaved.scala @@ -22,10 +22,12 @@ case class ShipmethodRowUnsaved( Primary key for ShipMethod records. */ shipmethodid: Defaulted[ShipmethodId] = Defaulted.UseDefault, /** Default: 0.00 - Minimum shipping charge. */ + Minimum shipping charge. + Constraint CK_ShipMethod_ShipBase affecting columns "shipbase": ((shipbase > 0.00)) */ shipbase: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Shipping charge per pound. */ + Shipping charge per pound. + Constraint CK_ShipMethod_ShipRate affecting columns "shiprate": ((shiprate > 0.00)) */ shiprate: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala index 264ca6ecd5..b9b62af12d 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/purchasing/vendor/VendorRowUnsaved.scala @@ -26,7 +26,8 @@ case class VendorRowUnsaved( accountnumber: AccountNumber, /** Company name. */ name: Name, - /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average */ + /** 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average + Constraint CK_Vendor_CreditRating affecting columns "creditrating": (((creditrating >= 1) AND (creditrating <= 5))) */ creditrating: TypoShort, /** Vendor URL. */ purchasingwebserviceurl: Option[/* max 1024 chars */ String], diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala index 95bb1f7812..82d9233351 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderdetail/SalesorderdetailRowUnsaved.scala @@ -24,7 +24,8 @@ case class SalesorderdetailRowUnsaved( salesorderid: SalesorderheaderId, /** Shipment tracking number supplied by the shipper. */ carriertrackingnumber: Option[/* max 25 chars */ String], - /** Quantity ordered per product. */ + /** Quantity ordered per product. + Constraint CK_SalesOrderDetail_OrderQty affecting columns "orderqty": ((orderqty > 0)) */ orderqty: TypoShort, /** Product sold to customer. Foreign key to Product.ProductID. Points to [[specialofferproduct.SpecialofferproductRow.productid]] */ @@ -32,13 +33,15 @@ case class SalesorderdetailRowUnsaved( /** Promotional code. Foreign key to SpecialOffer.SpecialOfferID. Points to [[specialofferproduct.SpecialofferproductRow.specialofferid]] */ specialofferid: SpecialofferId, - /** Selling price of a single product. */ + /** Selling price of a single product. + Constraint CK_SalesOrderDetail_UnitPrice affecting columns "unitprice": ((unitprice >= 0.00)) */ unitprice: BigDecimal, /** Default: nextval('sales.salesorderdetail_salesorderdetailid_seq'::regclass) Primary key. One incremental unique number per product sold. */ salesorderdetailid: Defaulted[Int] = Defaulted.UseDefault, /** Default: 0.0 - Discount amount. */ + Discount amount. + Constraint CK_SalesOrderDetail_UnitPriceDiscount affecting columns "unitpricediscount": ((unitpricediscount >= 0.00)) */ unitpricediscount: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala index 72a2bf17b8..4929e7e63b 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesorderheader/SalesorderheaderRowUnsaved.scala @@ -30,9 +30,11 @@ import scala.util.Try /** This class corresponds to a row in table `sales.salesorderheader` which has not been persisted yet */ case class SalesorderheaderRowUnsaved( - /** Date the order is due to the customer. */ + /** Date the order is due to the customer. + Constraint CK_SalesOrderHeader_DueDate affecting columns "orderdate", "duedate": ((duedate >= orderdate)) */ duedate: TypoLocalDateTime, - /** Date the order was shipped to the customer. */ + /** Date the order was shipped to the customer. + Constraint CK_SalesOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ shipdate: Option[TypoLocalDateTime], /** Customer purchase order number reference. */ purchaseordernumber: Option[OrderNumber], @@ -75,22 +77,28 @@ case class SalesorderheaderRowUnsaved( Incremental number to track changes to the sales order over time. */ revisionnumber: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: now() - Dates the sales order was created. */ + Dates the sales order was created. + Constraint CK_SalesOrderHeader_DueDate affecting columns "orderdate", "duedate": ((duedate >= orderdate)) + Constraint CK_SalesOrderHeader_ShipDate affecting columns "orderdate", "shipdate": (((shipdate >= orderdate) OR (shipdate IS NULL))) */ orderdate: Defaulted[TypoLocalDateTime] = Defaulted.UseDefault, /** Default: 1 - Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled */ + Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled + Constraint CK_SalesOrderHeader_Status affecting columns "status": (((status >= 0) AND (status <= 8))) */ status: Defaulted[TypoShort] = Defaulted.UseDefault, /** Default: true 0 = Order placed by sales person. 1 = Order placed online by customer. */ onlineorderflag: Defaulted[Flag] = Defaulted.UseDefault, /** Default: 0.00 - Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. */ + Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. + Constraint CK_SalesOrderHeader_SubTotal affecting columns "subtotal": ((subtotal >= 0.00)) */ subtotal: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Tax amount. */ + Tax amount. + Constraint CK_SalesOrderHeader_TaxAmt affecting columns "taxamt": ((taxamt >= 0.00)) */ taxamt: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Shipping cost. */ + Shipping cost. + Constraint CK_SalesOrderHeader_Freight affecting columns "freight": ((freight >= 0.00)) */ freight: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala index 4be5092267..117a3052fc 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesperson/SalespersonRowUnsaved.scala @@ -23,19 +23,24 @@ case class SalespersonRowUnsaved( /** Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: Option[SalesterritoryId], - /** Projected yearly sales. */ + /** Projected yearly sales. + Constraint CK_SalesPerson_SalesQuota affecting columns "salesquota": ((salesquota > 0.00)) */ salesquota: Option[BigDecimal], /** Default: 0.00 - Bonus due if quota is met. */ + Bonus due if quota is met. + Constraint CK_SalesPerson_Bonus affecting columns "bonus": ((bonus >= 0.00)) */ bonus: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Commision percent received per sale. */ + Commision percent received per sale. + Constraint CK_SalesPerson_CommissionPct affecting columns "commissionpct": ((commissionpct >= 0.00)) */ commissionpct: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Sales total year to date. */ + Sales total year to date. + Constraint CK_SalesPerson_SalesYTD affecting columns "salesytd": ((salesytd >= 0.00)) */ salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Sales total of previous year. */ + Sales total of previous year. + Constraint CK_SalesPerson_SalesLastYear affecting columns "saleslastyear": ((saleslastyear >= 0.00)) */ saleslastyear: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala index 2669eec07a..cbdcc3eec6 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salespersonquotahistory/SalespersonquotahistoryRowUnsaved.scala @@ -21,7 +21,8 @@ case class SalespersonquotahistoryRowUnsaved( businessentityid: BusinessentityId, /** Sales quota date. */ quotadate: TypoLocalDateTime, - /** Sales quota amount. */ + /** Sales quota amount. + Constraint CK_SalesPersonQuotaHistory_SalesQuota affecting columns "salesquota": ((salesquota > 0.00)) */ salesquota: BigDecimal, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala index c1f98664b7..81adaa2dac 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salestaxrate/SalestaxrateRowUnsaved.scala @@ -21,7 +21,8 @@ case class SalestaxrateRowUnsaved( /** State, province, or country/region the sales tax applies to. Points to [[person.stateprovince.StateprovinceRow.stateprovinceid]] */ stateprovinceid: StateprovinceId, - /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. */ + /** 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions. + Constraint CK_SalesTaxRate_TaxType affecting columns "taxtype": (((taxtype >= 1) AND (taxtype <= 3))) */ taxtype: TypoShort, /** Tax rate description. */ name: Name, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala index 74e9320026..7a717ea0e0 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritory/SalesterritoryRowUnsaved.scala @@ -28,16 +28,20 @@ case class SalesterritoryRowUnsaved( Primary key for SalesTerritory records. */ territoryid: Defaulted[SalesterritoryId] = Defaulted.UseDefault, /** Default: 0.00 - Sales in the territory year to date. */ + Sales in the territory year to date. + Constraint CK_SalesTerritory_SalesYTD affecting columns "salesytd": ((salesytd >= 0.00)) */ salesytd: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Sales in the territory the previous year. */ + Sales in the territory the previous year. + Constraint CK_SalesTerritory_SalesLastYear affecting columns "saleslastyear": ((saleslastyear >= 0.00)) */ saleslastyear: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Business costs in the territory year to date. */ + Business costs in the territory year to date. + Constraint CK_SalesTerritory_CostYTD affecting columns "costytd": ((costytd >= 0.00)) */ costytd: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0.00 - Business costs in the territory the previous year. */ + Business costs in the territory the previous year. + Constraint CK_SalesTerritory_CostLastYear affecting columns "costlastyear": ((costlastyear >= 0.00)) */ costlastyear: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala index 96c6a63178..a0b365bff7 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/salesterritoryhistory/SalesterritoryhistoryRowUnsaved.scala @@ -23,9 +23,11 @@ case class SalesterritoryhistoryRowUnsaved( /** Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID. Points to [[salesterritory.SalesterritoryRow.territoryid]] */ territoryid: SalesterritoryId, - /** Primary key. Date the sales representive started work in the territory. */ + /** Primary key. Date the sales representive started work in the territory. + Constraint CK_SalesTerritoryHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ startdate: TypoLocalDateTime, - /** Date the sales representative left work in the territory. */ + /** Date the sales representative left work in the territory. + Constraint CK_SalesTerritoryHistory_EndDate affecting columns "startdate", "enddate": (((enddate >= startdate) OR (enddate IS NULL))) */ enddate: Option[TypoLocalDateTime], /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala index 64570fb66a..22bc6c7195 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/shoppingcartitem/ShoppingcartitemRowUnsaved.scala @@ -24,7 +24,8 @@ case class ShoppingcartitemRowUnsaved( Primary key for ShoppingCartItem records. */ shoppingcartitemid: Defaulted[ShoppingcartitemId] = Defaulted.UseDefault, /** Default: 1 - Product quantity ordered. */ + Product quantity ordered. + Constraint CK_ShoppingCartItem_Quantity affecting columns "quantity": ((quantity >= 1)) */ quantity: Defaulted[Int] = Defaulted.UseDefault, /** Default: now() Date the time the record was created. */ diff --git a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala index 78696de944..d25884d488 100644 --- a/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala +++ b/typo-tester-doobie/generated-and-checked-in/adventureworks/sales/specialoffer/SpecialofferRowUnsaved.scala @@ -21,20 +21,25 @@ case class SpecialofferRowUnsaved( `type`: /* max 50 chars */ String, /** Group the discount applies to such as Reseller or Customer. */ category: /* max 50 chars */ String, - /** Discount start date. */ + /** Discount start date. + Constraint CK_SpecialOffer_EndDate affecting columns "startdate", "enddate": ((enddate >= startdate)) */ startdate: TypoLocalDateTime, - /** Discount end date. */ + /** Discount end date. + Constraint CK_SpecialOffer_EndDate affecting columns "startdate", "enddate": ((enddate >= startdate)) */ enddate: TypoLocalDateTime, - /** Maximum discount percent allowed. */ + /** Maximum discount percent allowed. + Constraint CK_SpecialOffer_MaxQty affecting columns "maxqty": ((maxqty >= 0)) */ maxqty: Option[Int], /** Default: nextval('sales.specialoffer_specialofferid_seq'::regclass) Primary key for SpecialOffer records. */ specialofferid: Defaulted[SpecialofferId] = Defaulted.UseDefault, /** Default: 0.00 - Discount precentage. */ + Discount precentage. + Constraint CK_SpecialOffer_DiscountPct affecting columns "discountpct": ((discountpct >= 0.00)) */ discountpct: Defaulted[BigDecimal] = Defaulted.UseDefault, /** Default: 0 - Minimum discount percent allowed. */ + Minimum discount percent allowed. + Constraint CK_SpecialOffer_MinQty affecting columns "minqty": ((minqty >= 0)) */ minqty: Defaulted[Int] = Defaulted.UseDefault, /** Default: uuid_generate_v1() */ rowguid: Defaulted[TypoUUID] = Defaulted.UseDefault, diff --git a/typo/src/scala/typo/internal/codegen/FilesTable.scala b/typo/src/scala/typo/internal/codegen/FilesTable.scala index f949d52b59..754e33621d 100644 --- a/typo/src/scala/typo/internal/codegen/FilesTable.scala +++ b/typo/src/scala/typo/internal/codegen/FilesTable.scala @@ -48,13 +48,14 @@ case class FilesTable(table: ComputedTable, options: InternalOptions, genOrderin } val formattedCols = unsaved.allCols.map { col => - val commentPieces = List( + val commentPieces = List[Iterable[String]]( col.dbCol.columnDefault.map(x => s"Default: $x"), col.dbCol.comment, col.pointsTo map { case (relationName, columnName) => val shortened = sc.QIdent(relation.dropCommonPrefix(table.naming.rowName(relationName).idents, rowFile.tpe.value.idents)) s"Points to [[${sc.renderTree(shortened)}.${table.naming.field(columnName).value}]]" }, + col.dbCol.constraints.map(c => s"Constraint ${c.name} affecting columns ${c.columns.map(_.code.render.asString).mkString(", ")}: ${c.checkClause}"), if (options.debugTypes) col.dbCol.jsonDescription.maybeJson.map(other => s"debug: ${Json.stringify(other)}") else None