1 Project PostgreSQL @ DbSchema.com Layout Default Column comments as mouse-over tooltips. Fk shift_breaks_breakid shift_breaks ref breaks ( breakid -> id ) breakid Fk shift_breaks_shiftid shift_breaks ref shifts ( shiftid -> id ) shiftid Fk leaves_pplid leaves ref people ( pplid -> id ) pplid Fk products_attrset_fk products ref attributeset ( attributeset_id -> id ) attributeset_id Fk products_fk_1 products ref categories ( category -> id ) category Fk products_taxcat_fk products ref taxcategories ( taxcat -> id ) taxcat Fk categories_fk_1 categories ref categories ( parentid -> id ) parentid Fk products_com_fk_1 products_com ref products ( product -> id ) product Fk products_com_fk_2 products_com ref products ( product2 -> id ) product2 Fk customers_taxcat customers ref taxcustcategories ( taxcategory -> id ) taxcategory Fk places_fk_1 places ref floors ( floor -> id ) floor Fk products_cat_fk_1 products_cat ref products ( product -> id ) product Fk people_fk_1 people ref roles ( role -> id ) role Fk tickets_customers_fk tickets ref customers ( customer -> id ) customer Fk tickets_fk_2 tickets ref people ( person -> id ) person Fk tickets_fk_id tickets ref receipts ( id ) id Fk ticketlines_attsetinst ticketlines ref attributesetinstance ( attributesetinstance_id -> id ) attributesetinstance_id Fk ticketlines_fk_2 ticketlines ref products ( product -> id ) product Fk ticketlines_fk_3 ticketlines ref taxes ( taxid -> id ) taxid Fk ticketlines_fk_ticket ticketlines ref tickets ( ticket -> id ) ticket Fk taxes_cat_fk taxes ref taxcategories ( category -> id ) category Fk taxes_custcat_fk taxes ref taxcustcategories ( custcategory -> id ) custcategory Fk taxes_taxes_fk taxes ref taxes ( parentid -> id ) parentid Fk taxlines_receipt taxlines ref receipts ( receipt -> id ) receipt Fk taxlines_tax taxlines ref taxes ( taxid -> id ) taxid Fk receipts_fk_money receipts ref closedcash ( money ) money Fk stockdiary_attsetinst stockdiary ref attributesetinstance ( attributesetinstance_id -> id ) attributesetinstance_id Fk stockdiary_fk_2 stockdiary ref locations ( location -> id ) location Fk stockdiary_fk_1 stockdiary ref products ( product -> id ) product Fk attsetinst_set attributesetinstance ref attributeset ( attributeset_id -> id ) attributeset_id Fk attuse_att attributeuse ref attribute ( attribute_id -> id ) attribute_id Fk attuse_set attributeuse ref attributeset ( attributeset_id -> id ) attributeset_id Fk attinst_att attributeinstance ref attribute ( attribute_id -> id ) attribute_id Fk attinst_set attributeinstance ref attributesetinstance ( attributesetinstance_id -> id ) attributesetinstance_id Fk stockcurrent_attsetinst stockcurrent ref attributesetinstance ( attributesetinstance_id -> id ) attributesetinstance_id Fk stockcurrent_fk_2 stockcurrent ref locations ( location -> id ) location Fk stockcurrent_fk_1 stockcurrent ref products ( product -> id ) product Fk stocklevel_location stocklevel ref locations ( location -> id ) location Fk stocklevel_product stocklevel ref products ( product -> id ) product Fk attval_att attributevalue ref attribute ( attribute_id -> id ) attribute_id Fk res_cust_fk_2 reservation_customers ref customers ( customer -> id ) customer Fk res_cust_fk_1 reservation_customers ref reservations ( id ) id Fk payments_fk_receipt payments ref receipts ( receipt -> id ) receipt applicationsTable public.applications Pk applications_pkey ( id ) idid * varchar(2147483647) namename * varchar(2147483647) versionversion * varchar(2147483647) csvimportTable public.csvimport Pk csvimport_pkey ( id ) idid * varchar(2147483647) rownumberrownumber varchar(2147483647) csverrorcsverror varchar(2147483647) referencereference varchar(2147483647) codecode varchar(2147483647) namename varchar(2147483647) pricebuypricebuy float8 pricesellpricesell float8 previousbuypreviousbuy float8 previoussellprevioussell float8 categorycategory varchar(2147483647) shift_breaksTable public.shift_breaks Pk shift_breaks_pkey ( id ) idid * varchar(2147483647) shiftidshiftid * varchar(2147483647) References shifts ( shiftid -> id ) breakidbreakid * varchar(2147483647) References breaks ( breakid -> id ) starttimestarttime * timestamp endtimeendtime timestamp breaksTable public.breaks Pk breaks_pkey ( id ) idid * varchar(2147483647) Referred by shift_breaks ( breakid -> id ) namename * varchar(2147483647) notesnotes varchar(2147483647) visiblevisible * bool shiftsTable public.shifts Pk shifts_pkey ( id ) idid * varchar(2147483647) Referred by shift_breaks ( shiftid -> id ) startshiftstartshift * timestamp endshiftendshift timestamp pplidpplid * varchar(2147483647) leavesTable public.leaves Pk leaves_pkey ( id ) idid * varchar(2147483647) pplidpplid * varchar(2147483647) References people ( pplid -> id ) namename * varchar(2147483647) startdatestartdate * timestamp enddateenddate * timestamp notesnotes varchar(2147483647) resourcesTable public.resources Pk resources_pkey ( id ) idid * varchar(2147483647) Unq resources_name_inx ( name ) namename * varchar(2147483647) restyperestype * integer contentcontent bytea productsTable public.products Pk products_pkey ( id ) idid * varchar(2147483647) Referred by products_cat ( product -> id ) Referred by products_com ( product -> id ) Referred by products_com ( product2 -> id ) Referred by stockcurrent ( product -> id ) Referred by stockdiary ( product -> id ) Referred by stocklevel ( product -> id ) Referred by ticketlines ( product -> id ) Unq products_inx_0 ( reference ) referencereference * varchar(2147483647) Unq products_inx_1 ( code ) codecode * varchar(2147483647) codetypecodetype varchar(2147483647) Unq products_name_inx ( name ) namename * varchar(2147483647) pricebuypricebuy * float8 default 0 pricesellpricesell * float8 default 0 categorycategory * varchar(2147483647) References categories ( category -> id ) taxcattaxcat * varchar(2147483647) References taxcategories ( taxcat -> id ) attributeset_idattributeset_id varchar(2147483647) References attributeset ( attributeset_id -> id ) stockcoststockcost float8 stockvolumestockvolume float8 imageimage bytea iscomiscom * bool default false isscaleisscale * bool default false iskitcheniskitchen * bool default false printkbprintkb * bool default false sendstatussendstatus * bool default false isserviceisservice * bool default false displaydisplay varchar(2147483647) attributesattributes bytea isvpriceisvprice * bool default false isverpatribisverpatrib * bool default false texttiptexttip varchar(2147483647) default ''::character varying warrantywarranty * bool default false stockunitsstockunits * float8 default 0 categoriesTable public.categories Pk categories_pkey ( id ) idid * varchar(2147483647) Referred by categories ( parentid -> id ) Referred by products ( category -> id ) Unq categories_name_inx ( name ) namename * varchar(2147483647) parentidparentid varchar(2147483647) References categories ( parentid -> id ) imageimage bytea texttiptexttip varchar(2147483647) catshownamecatshowname * bool default true lineremovedTable public.lineremoved removeddateremoveddate * timestamp default now() namename varchar(2147483647) ticketidticketid varchar(2147483647) productidproductid varchar(2147483647) productnameproductname varchar(2147483647) unitsunits * float8 products_comTable public.products_com Pk products_com_pkey ( id ) idid * varchar(2147483647) Unq pcom_inx_prod ( product, product2 ) productproduct * varchar(2147483647) References products ( product -> id ) Unq pcom_inx_prod ( product, product2 ) product2product2 * varchar(2147483647) References products ( product2 -> id ) customersTable public.customers Pk customers_pkey ( id ) idid * varchar(2147483647) Referred by reservation_customers ( customer -> id ) Referred by tickets ( customer -> id ) Unq customers_skey_inx ( searchkey ) searchkeysearchkey * varchar(2147483647) customers_taxid_inx ( taxid ) taxidtaxid varchar(2147483647) customers_name_inx ( name ) namename * varchar(2147483647) taxcategorytaxcategory varchar(2147483647) References taxcustcategories ( taxcategory -> id ) customers_card_inx ( card ) cardcard varchar(2147483647) maxdebtmaxdebt * float8 default 0 addressaddress varchar(2147483647) address2address2 varchar(2147483647) postalpostal varchar(2147483647) citycity varchar(2147483647) regionregion varchar(2147483647) countrycountry varchar(2147483647) firstnamefirstname varchar(2147483647) lastnamelastname varchar(2147483647) emailemail varchar(2147483647) phonephone varchar(2147483647) phone2phone2 varchar(2147483647) faxfax varchar(2147483647) notesnotes varchar(2147483647) visiblevisible * bool default true curdatecurdate timestamp curdebtcurdebt float8 default 0 imageimage bytea draweropenedTable public.draweropened opendateopendate timestamp default now() namename varchar(2147483647) ticketidticketid varchar(2147483647) moorersTable public.moorers vesselnamevesselname varchar(2147483647) sizesize integer daysdays integer powerpower * bool default false floorsTable public.floors Pk floors_pkey ( id ) idid * varchar(2147483647) Referred by places ( floor -> id ) Unq floors_name_inx ( name ) namename * varchar(2147483647) imageimage bytea placesTable public.places Pk places_pkey ( id ) idid * varchar(2147483647) Unq places_name_inx ( name ) namename * varchar(2147483647) xx * integer yy * integer floorfloor * varchar(2147483647) References floors ( floor -> id ) customercustomer varchar(2147483647) waiterwaiter varchar(2147483647) ticketidticketid varchar(2147483647) tablemovedtablemoved * bool default false products_catTable public.products_cat Pk products_cat_pkey ( product ) productproduct * varchar(2147483647) References products ( product -> id ) products_cat_inx_1 ( catorder ) catordercatorder integer rolesTable public.roles Pk roles_pkey ( id ) idid * varchar(2147483647) Referred by people ( role -> id ) Unq roles_name_inx ( name ) namename * varchar(2147483647) permissionspermissions bytea peopleTable public.people Pk people_pkey ( id ) idid * varchar(2147483647) Referred by leaves ( pplid -> id ) Referred by tickets ( person -> id ) Unq people_name_inx ( name ) namename * varchar(2147483647) apppasswordapppassword varchar(2147483647) people_card_inx ( card ) cardcard varchar(2147483647) rolerole * varchar(2147483647) References roles ( role -> id ) visiblevisible * bool imageimage bytea ticketsTable public.tickets Pk tickets_pkey ( id ) idid * varchar(2147483647) References receipts ( id ) Referred by ticketlines ( ticket -> id ) tickets_ticketid ( tickettype, ticketid ) tickettypetickettype * integer default 0 tickets_ticketid ( tickettype, ticketid ) ticketidticketid * integer personperson * varchar(2147483647) References people ( person -> id ) customercustomer varchar(2147483647) References customers ( customer -> id ) statusstatus * integer default 0 ticketlinesTable public.ticketlines Pk ticketlines_pkey ( ticket, line ) ticketticket * varchar(2147483647) References tickets ( ticket -> id ) Pk ticketlines_pkey ( ticket, line ) lineline * integer productproduct varchar(2147483647) References products ( product -> id ) attributesetinstance_idattributesetinstance_id varchar(2147483647) References attributesetinstance ( attributesetinstance_id -> id ) unitsunits * float8 priceprice * float8 taxidtaxid * varchar(2147483647) References taxes ( taxid -> id ) attributesattributes bytea taxcustcategoriesTable public.taxcustcategories Pk taxcustcategories_pkey ( id ) idid * varchar(2147483647) Referred by customers ( taxcategory -> id ) Referred by taxes ( custcategory -> id ) Unq taxcustcat_name_inx ( name ) namename * varchar(2147483647) taxesTable public.taxes Pk taxes_pkey ( id ) idid * varchar(2147483647) Referred by taxes ( parentid -> id ) Referred by taxlines ( taxid -> id ) Referred by ticketlines ( taxid -> id ) Unq taxes_name_inx ( name ) namename * varchar(2147483647) categorycategory * varchar(2147483647) References taxcategories ( category -> id ) custcategorycustcategory varchar(2147483647) References taxcustcategories ( custcategory -> id ) parentidparentid varchar(2147483647) References taxes ( parentid -> id ) raterate * float8 default 0 ratecascaderatecascade * bool default false rateorderrateorder integer attributeTable public.attribute Pk attribute_pkey ( id ) idid * varchar(2147483647) Referred by attributeinstance ( attribute_id -> id ) Referred by attributeuse ( attribute_id -> id ) Referred by attributevalue ( attribute_id -> id ) namename * varchar(2147483647) thirdpartiesTable public.thirdparties Pk thirdparties_pkey ( id ) idid * varchar(2147483647) Unq thirdparties_cif_inx ( cif ) cifcif * varchar(2147483647) Unq thirdparties_name_inx ( name ) namename * varchar(2147483647) addressaddress varchar(2147483647) contactcommcontactcomm varchar(2147483647) contactfactcontactfact varchar(2147483647) payrulepayrule varchar(2147483647) faxnumberfaxnumber varchar(2147483647) phonenumberphonenumber varchar(2147483647) mobilenumbermobilenumber varchar(2147483647) emailemail varchar(2147483647) webpagewebpage varchar(2147483647) notesnotes varchar(2147483647) taxlinesTable public.taxlines Pk taxlines_pkey ( id ) idid * varchar(2147483647) receiptreceipt * varchar(2147483647) References receipts ( receipt -> id ) taxidtaxid * varchar(2147483647) References taxes ( taxid -> id ) basebase * float8 default 0 amountamount * float8 default 0 receiptsTable public.receipts Pk receipts_pkey ( id ) idid * varchar(2147483647) Referred by payments ( receipt -> id ) Referred by taxlines ( receipt -> id ) Referred by tickets ( id ) moneymoney * varchar(2147483647) References closedcash ( money ) receipts_inx_1 ( datenew ) datenewdatenew * timestamp attributesattributes bytea personperson varchar(2147483647) stockdiaryTable public.stockdiary Pk stockdiary_pkey ( id ) idid * varchar(2147483647) stockdiary_inx_1 ( datenew ) datenewdatenew * timestamp reasonreason * integer locationlocation * varchar(2147483647) References locations ( location -> id ) productproduct * varchar(2147483647) References products ( product -> id ) attributesetinstance_idattributesetinstance_id varchar(2147483647) References attributesetinstance ( attributesetinstance_id -> id ) unitsunits * float8 priceprice * float8 appuserappuser varchar(2147483647) attributesetinstanceTable public.attributesetinstance Pk attributesetinstance_pkey ( id ) idid * varchar(2147483647) Referred by attributeinstance ( attributesetinstance_id -> id ) Referred by stockcurrent ( attributesetinstance_id -> id ) Referred by stockdiary ( attributesetinstance_id -> id ) Referred by ticketlines ( attributesetinstance_id -> id ) attributeset_idattributeset_id * varchar(2147483647) References attributeset ( attributeset_id -> id ) descriptiondescription varchar(2147483647) attributesetTable public.attributeset Pk attributeset_pkey ( id ) idid * varchar(2147483647) Referred by attributesetinstance ( attributeset_id -> id ) Referred by attributeuse ( attributeset_id -> id ) Referred by products ( attributeset_id -> id ) namename * varchar(2147483647) attributeuseTable public.attributeuse Pk attributeuse_pkey ( id ) idid * varchar(2147483647) Unq attuse_line ( attributeset_id, lineno ) attributeset_idattributeset_id * varchar(2147483647) References attributeset ( attributeset_id -> id ) attribute_idattribute_id * varchar(2147483647) References attribute ( attribute_id -> id ) Unq attuse_line ( attributeset_id, lineno ) linenolineno integer attributeinstanceTable public.attributeinstance Pk attributeinstance_pkey ( id ) idid * varchar(2147483647) attributesetinstance_idattributesetinstance_id * varchar(2147483647) References attributesetinstance ( attributesetinstance_id -> id ) attribute_idattribute_id * varchar(2147483647) References attribute ( attribute_id -> id ) valuevalue varchar(2147483647) stockcurrentTable public.stockcurrent Unq stockcurrent_inx ( location, product, attributesetinstance_id ) locationlocation * varchar(2147483647) References locations ( location -> id ) Unq stockcurrent_inx ( location, product, attributesetinstance_id ) productproduct * varchar(2147483647) References products ( product -> id ) Unq stockcurrent_inx ( location, product, attributesetinstance_id ) attributesetinstance_idattributesetinstance_id varchar(2147483647) References attributesetinstance ( attributesetinstance_id -> id ) unitsunits * float8 default 0 stocklevelTable public.stocklevel Pk stocklevel_pkey ( id ) idid * varchar(2147483647) locationlocation * varchar(2147483647) References locations ( location -> id ) productproduct * varchar(2147483647) References products ( product -> id ) stocksecuritystocksecurity * float8 default 0 stockmaximumstockmaximum * float8 default 0 locationsTable public.locations Pk locations_pkey ( id ) idid * varchar(2147483647) Referred by stockcurrent ( location -> id ) Referred by stockdiary ( location -> id ) Referred by stocklevel ( location -> id ) Unq locations_name_inx ( name ) namename * varchar(2147483647) addressaddress varchar(2147483647) sharedticketsTable public.sharedtickets Pk sharedtickets_pkey ( id ) idid * varchar(2147483647) namename * varchar(2147483647) contentcontent bytea pickupidpickupid * integer default 0 appuserappuser varchar(2147483647) taxcategoriesTable public.taxcategories Pk taxcategories_pkey ( id ) idid * varchar(2147483647) Referred by products ( taxcat -> id ) Referred by taxes ( category -> id ) Unq taxcat_name_inx ( name ) namename * varchar(2147483647) attributevalueTable public.attributevalue Pk attributevalue_pkey ( id ) idid * varchar(2147483647) attribute_idattribute_id * varchar(2147483647) References attribute ( attribute_id -> id ) valuevalue varchar(2147483647) closedcashTable public.closedcash Pk closedcash_pkey ( money ) moneymoney * varchar(2147483647) Referred by receipts ( money ) Unq closedcash_inx_seq ( host, hostsequence ) hosthost * varchar(2147483647) Unq closedcash_inx_seq ( host, hostsequence ) hostsequencehostsequence * integer closedcash_inx_1 ( datestart ) datestartdatestart * timestamp dateenddateend timestamp nosalesnosales * integer default 0 reservationsTable public.reservations Pk reservations_pkey ( id ) idid * varchar(2147483647) Referred by reservation_customers ( id ) createdcreated * timestamp reservations_inx_1 ( datenew ) datenewdatenew * timestamp default '2013-01-01 00:00:00'::timestamp without time zone titletitle * varchar(2147483647) chairschairs * integer isdoneisdone * bool descriptiondescription varchar(2147483647) reservation_customersTable public.reservation_customers Pk reservation_customers_pkey ( id ) idid * varchar(2147483647) References reservations ( id ) customercustomer * varchar(2147483647) References customers ( customer -> id ) paymentsTable public.payments Pk payments_pkey ( id ) idid * varchar(2147483647) receiptreceipt * varchar(2147483647) References receipts ( receipt -> id ) payments_inx_1 ( payment ) paymentpayment * varchar(2147483647) totaltotal * float8 transidtransid varchar(2147483647) notesnotes varchar(2147483647) returnmsgreturnmsg bytea tenderedtendered * float8 default 0 cardnamecardname varchar(2147483647)

Table applications
* id varchar( 2147483647 )
* name varchar( 2147483647 )
* version varchar( 2147483647 )
Indexes
Pkapplications_pkey ON id


Table csvimport
* id varchar( 2147483647 )
  rownumber varchar( 2147483647 )
  csverror varchar( 2147483647 )
  reference varchar( 2147483647 )
  code varchar( 2147483647 )
  name varchar( 2147483647 )
  pricebuy float8
  pricesell float8
  previousbuy float8
  previoussell float8
  category varchar( 2147483647 )
Indexes
Pkcsvimport_pkey ON id


Table shift_breaks
* id varchar( 2147483647 )
* shiftid varchar( 2147483647 )
* breakid varchar( 2147483647 )
* starttime timestamp
  endtime timestamp
Indexes
Pkshift_breaks_pkey ON id
Foreign Keys
 shift_breaks_breakid ( breakid ) ref breaks (id)
 shift_breaks_shiftid ( shiftid ) ref shifts (id)


Table breaks
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  notes varchar( 2147483647 )
* visible bool
Indexes
Pkbreaks_pkey ON id


Table shifts
* id varchar( 2147483647 )
* startshift timestamp
  endshift timestamp
* pplid varchar( 2147483647 )
Indexes
Pkshifts_pkey ON id


Table leaves
* id varchar( 2147483647 )
* pplid varchar( 2147483647 )
* name varchar( 2147483647 )
* startdate timestamp
* enddate timestamp
  notes varchar( 2147483647 )
Indexes
Pkleaves_pkey ON id
Foreign Keys
 leaves_pplid ( pplid ) ref people (id)


Table resources
* id varchar( 2147483647 )
* name varchar( 2147483647 )
* restype integer
  content bytea
Indexes
Pkresources_pkey ON id
Uresources_name_inx ON name


Table products
* id varchar( 2147483647 )
* reference varchar( 2147483647 )
* code varchar( 2147483647 )
  codetype varchar( 2147483647 )
* name varchar( 2147483647 )
* pricebuy float8 DEFO 0
* pricesell float8 DEFO 0
* category varchar( 2147483647 )
* taxcat varchar( 2147483647 )
  attributeset_id varchar( 2147483647 )
  stockcost float8
  stockvolume float8
  image bytea
* iscom bool DEFO false
* isscale bool DEFO false
* iskitchen bool DEFO false
* printkb bool DEFO false
* sendstatus bool DEFO false
* isservice bool DEFO false
  display varchar( 2147483647 )
  attributes bytea
* isvprice bool DEFO false
* isverpatrib bool DEFO false
  texttip varchar( 2147483647 ) DEFO ''::character varying
* warranty bool DEFO false
* stockunits float8 DEFO 0
Indexes
Pkproducts_pkey ON id
Uproducts_inx_0 ON reference
Uproducts_inx_1 ON code
Uproducts_name_inx ON name
Foreign Keys
 products_attrset_fk ( attributeset_id ) ref attributeset (id)
 products_fk_1 ( category ) ref categories (id)
 products_taxcat_fk ( taxcat ) ref taxcategories (id)


Table categories
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  parentid varchar( 2147483647 )
  image bytea
  texttip varchar( 2147483647 )
* catshowname bool DEFO true
Indexes
Pkcategories_pkey ON id
Ucategories_name_inx ON name
Foreign Keys
 categories_fk_1 ( parentid ) ref categories (id)


Table lineremoved
* removeddate timestamp DEFO now()
  name varchar( 2147483647 )
  ticketid varchar( 2147483647 )
  productid varchar( 2147483647 )
  productname varchar( 2147483647 )
* units float8


Table products_com
* id varchar( 2147483647 )
* product varchar( 2147483647 )
* product2 varchar( 2147483647 )
Indexes
Pkproducts_com_pkey ON id
Upcom_inx_prod ON product, product2
Foreign Keys
 products_com_fk_1 ( product ) ref products (id)
 products_com_fk_2 ( product2 ) ref products (id)


Table customers
* id varchar( 2147483647 )
* searchkey varchar( 2147483647 )
  taxid varchar( 2147483647 )
* name varchar( 2147483647 )
  taxcategory varchar( 2147483647 )
  card varchar( 2147483647 )
* maxdebt float8 DEFO 0
  address varchar( 2147483647 )
  address2 varchar( 2147483647 )
  postal varchar( 2147483647 )
  city varchar( 2147483647 )
  region varchar( 2147483647 )
  country varchar( 2147483647 )
  firstname varchar( 2147483647 )
  lastname varchar( 2147483647 )
  email varchar( 2147483647 )
  phone varchar( 2147483647 )
  phone2 varchar( 2147483647 )
  fax varchar( 2147483647 )
  notes varchar( 2147483647 )
* visible bool DEFO true
  curdate timestamp
  curdebt float8 DEFO 0
  image bytea
Indexes
Pkcustomers_pkey ON id
Ucustomers_skey_inx ON searchkey
 customers_card_inx ON card
 customers_name_inx ON name
 customers_taxid_inx ON taxid
Foreign Keys
 customers_taxcat ( taxcategory ) ref taxcustcategories (id)


Table draweropened
  opendate timestamp DEFO now()
  name varchar( 2147483647 )
  ticketid varchar( 2147483647 )


Table moorers
  vesselname varchar( 2147483647 )
  size integer
  days integer
* power bool DEFO false


Table floors
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  image bytea
Indexes
Pkfloors_pkey ON id
Ufloors_name_inx ON name


Table places
* id varchar( 2147483647 )
* name varchar( 2147483647 )
* x integer
* y integer
* floor varchar( 2147483647 )
  customer varchar( 2147483647 )
  waiter varchar( 2147483647 )
  ticketid varchar( 2147483647 )
* tablemoved bool DEFO false
Indexes
Pkplaces_pkey ON id
Uplaces_name_inx ON name
Foreign Keys
 places_fk_1 ( floor ) ref floors (id)


Table products_cat
* product varchar( 2147483647 )
  catorder integer
Indexes
Pkproducts_cat_pkey ON product
 products_cat_inx_1 ON catorder
Foreign Keys
 products_cat_fk_1 ( product ) ref products (id)


Table roles
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  permissions bytea
Indexes
Pkroles_pkey ON id
Uroles_name_inx ON name


Table people
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  apppassword varchar( 2147483647 )
  card varchar( 2147483647 )
* role varchar( 2147483647 )
* visible bool
  image bytea
Indexes
Pkpeople_pkey ON id
Upeople_name_inx ON name
 people_card_inx ON card
Foreign Keys
 people_fk_1 ( role ) ref roles (id)


Table tickets
* id varchar( 2147483647 )
* tickettype integer DEFO 0
* ticketid integer
* person varchar( 2147483647 )
  customer varchar( 2147483647 )
* status integer DEFO 0
Indexes
Pktickets_pkey ON id
 tickets_ticketid ON tickettype, ticketid
Foreign Keys
 tickets_customers_fk ( customer ) ref customers (id)
 tickets_fk_2 ( person ) ref people (id)
 tickets_fk_id ( id ) ref receipts (id)


Table ticketlines
* ticket varchar( 2147483647 )
* line integer
  product varchar( 2147483647 )
  attributesetinstance_id varchar( 2147483647 )
* units float8
* price float8
* taxid varchar( 2147483647 )
  attributes bytea
Indexes
Pkticketlines_pkey ON ticket, line
Foreign Keys
 ticketlines_attsetinst ( attributesetinstance_id ) ref attributesetinstance (id)
 ticketlines_fk_2 ( product ) ref products (id)
 ticketlines_fk_3 ( taxid ) ref taxes (id)
 ticketlines_fk_ticket ( ticket ) ref tickets (id)


Table taxcustcategories
* id varchar( 2147483647 )
* name varchar( 2147483647 )
Indexes
Pktaxcustcategories_pkey ON id
Utaxcustcat_name_inx ON name


Table taxes
* id varchar( 2147483647 )
* name varchar( 2147483647 )
* category varchar( 2147483647 )
  custcategory varchar( 2147483647 )
  parentid varchar( 2147483647 )
* rate float8 DEFO 0
* ratecascade bool DEFO false
  rateorder integer
Indexes
Pktaxes_pkey ON id
Utaxes_name_inx ON name
Foreign Keys
 taxes_cat_fk ( category ) ref taxcategories (id)
 taxes_custcat_fk ( custcategory ) ref taxcustcategories (id)
 taxes_taxes_fk ( parentid ) ref taxes (id)


Table attribute
* id varchar( 2147483647 )
* name varchar( 2147483647 )
Indexes
Pkattribute_pkey ON id


Table thirdparties
* id varchar( 2147483647 )
* cif varchar( 2147483647 )
* name varchar( 2147483647 )
  address varchar( 2147483647 )
  contactcomm varchar( 2147483647 )
  contactfact varchar( 2147483647 )
  payrule varchar( 2147483647 )
  faxnumber varchar( 2147483647 )
  phonenumber varchar( 2147483647 )
  mobilenumber varchar( 2147483647 )
  email varchar( 2147483647 )
  webpage varchar( 2147483647 )
  notes varchar( 2147483647 )
Indexes
Pkthirdparties_pkey ON id
Uthirdparties_cif_inx ON cif
Uthirdparties_name_inx ON name


Table taxlines
* id varchar( 2147483647 )
* receipt varchar( 2147483647 )
* taxid varchar( 2147483647 )
* base float8 DEFO 0
* amount float8 DEFO 0
Indexes
Pktaxlines_pkey ON id
Foreign Keys
 taxlines_receipt ( receipt ) ref receipts (id)
 taxlines_tax ( taxid ) ref taxes (id)


Table receipts
* id varchar( 2147483647 )
* money varchar( 2147483647 )
* datenew timestamp
  attributes bytea
  person varchar( 2147483647 )
Indexes
Pkreceipts_pkey ON id
 receipts_inx_1 ON datenew
Foreign Keys
 receipts_fk_money ( money ) ref closedcash (money)


Table stockdiary
* id varchar( 2147483647 )
* datenew timestamp
* reason integer
* location varchar( 2147483647 )
* product varchar( 2147483647 )
  attributesetinstance_id varchar( 2147483647 )
* units float8
* price float8
  appuser varchar( 2147483647 )
Indexes
Pkstockdiary_pkey ON id
 stockdiary_inx_1 ON datenew
Foreign Keys
 stockdiary_attsetinst ( attributesetinstance_id ) ref attributesetinstance (id)
 stockdiary_fk_2 ( location ) ref locations (id)
 stockdiary_fk_1 ( product ) ref products (id)


Table attributesetinstance
* id varchar( 2147483647 )
* attributeset_id varchar( 2147483647 )
  description varchar( 2147483647 )
Indexes
Pkattributesetinstance_pkey ON id
Foreign Keys
 attsetinst_set ( attributeset_id ) ref attributeset (id)


Table attributeset
* id varchar( 2147483647 )
* name varchar( 2147483647 )
Indexes
Pkattributeset_pkey ON id


Table attributeuse
* id varchar( 2147483647 )
* attributeset_id varchar( 2147483647 )
* attribute_id varchar( 2147483647 )
  lineno integer
Indexes
Pkattributeuse_pkey ON id
Uattuse_line ON attributeset_id, lineno
Foreign Keys
 attuse_att ( attribute_id ) ref attribute (id)
 attuse_set ( attributeset_id ) ref attributeset (id)


Table attributeinstance
* id varchar( 2147483647 )
* attributesetinstance_id varchar( 2147483647 )
* attribute_id varchar( 2147483647 )
  value varchar( 2147483647 )
Indexes
Pkattributeinstance_pkey ON id
Foreign Keys
 attinst_att ( attribute_id ) ref attribute (id)
 attinst_set ( attributesetinstance_id ) ref attributesetinstance (id)


Table stockcurrent
* location varchar( 2147483647 )
* product varchar( 2147483647 )
  attributesetinstance_id varchar( 2147483647 )
* units float8 DEFO 0
Indexes
Ustockcurrent_inx ON location, product, attributesetinstance_id
Foreign Keys
 stockcurrent_attsetinst ( attributesetinstance_id ) ref attributesetinstance (id)
 stockcurrent_fk_2 ( location ) ref locations (id)
 stockcurrent_fk_1 ( product ) ref products (id)


Table stocklevel
* id varchar( 2147483647 )
* location varchar( 2147483647 )
* product varchar( 2147483647 )
* stocksecurity float8 DEFO 0
* stockmaximum float8 DEFO 0
Indexes
Pkstocklevel_pkey ON id
Foreign Keys
 stocklevel_location ( location ) ref locations (id)
 stocklevel_product ( product ) ref products (id)


Table locations
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  address varchar( 2147483647 )
Indexes
Pklocations_pkey ON id
Ulocations_name_inx ON name


Table sharedtickets
* id varchar( 2147483647 )
* name varchar( 2147483647 )
  content bytea
* pickupid integer DEFO 0
  appuser varchar( 2147483647 )
Indexes
Pksharedtickets_pkey ON id


Table taxcategories
* id varchar( 2147483647 )
* name varchar( 2147483647 )
Indexes
Pktaxcategories_pkey ON id
Utaxcat_name_inx ON name


Table attributevalue
* id varchar( 2147483647 )
* attribute_id varchar( 2147483647 )
  value varchar( 2147483647 )
Indexes
Pkattributevalue_pkey ON id
Foreign Keys
 attval_att ( attribute_id ) ref attribute (id)


Table closedcash
* money varchar( 2147483647 )
* host varchar( 2147483647 )
* hostsequence integer
* datestart timestamp
  dateend timestamp
* nosales integer DEFO 0
Indexes
Pkclosedcash_pkey ON money
Uclosedcash_inx_seq ON host, hostsequence
 closedcash_inx_1 ON datestart


Table reservations
* id varchar( 2147483647 )
* created timestamp
* datenew timestamp DEFO '2013-01-01 00:00:00'::timestamp without time zone
* title varchar( 2147483647 )
* chairs integer
* isdone bool
  description varchar( 2147483647 )
Indexes
Pkreservations_pkey ON id
 reservations_inx_1 ON datenew


Table reservation_customers
* id varchar( 2147483647 )
* customer varchar( 2147483647 )
Indexes
Pkreservation_customers_pkey ON id
Foreign Keys
 res_cust_fk_2 ( customer ) ref customers (id)
 res_cust_fk_1 ( id ) ref reservations (id)


Table payments
* id varchar( 2147483647 )
* receipt varchar( 2147483647 )
* payment varchar( 2147483647 )
* total float8
  transid varchar( 2147483647 )
  notes varchar( 2147483647 )
  returnmsg bytea
* tendered float8 DEFO 0
  cardname varchar( 2147483647 )
Indexes
Pkpayments_pkey ON id
 payments_inx_1 ON payment
Foreign Keys
 payments_fk_receipt ( receipt ) ref receipts (id)