Guest User

invoice table and indexes

a guest
Apr 2nd, 2013
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 KB | None | 0 0
  1. CREATE TABLE invoice
  2. (
  3. id integer NOT NULL,
  4. company_id integer,
  5. fee_type_id integer,
  6. user_id integer,
  7. opportunity_id integer,
  8. group_by_id integer,
  9. status_id integer,
  10. updated_by_id integer,
  11. created_by_id integer,
  12. title character varying(60) DEFAULT NULL::character varying,
  13. show_on_portal boolean,
  14. taxable boolean,
  15. description text,
  16. revision_req text,
  17. bill_note text,
  18. bill numeric(10,2) DEFAULT NULL::numeric,
  19. search tsvector, -- (DC2Type:tsvector)
  20. updated timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
  21. created timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
  22. deleted timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
  23. invoiced timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
  24. invoiced_by_id integer,
  25. rate numeric(10,2) DEFAULT NULL::numeric,
  26. estimated_minutes integer,
  27. department_id integer,
  28. CONSTRAINT invoice_pkey PRIMARY KEY (id ),
  29. CONSTRAINT fk_9065174426fa54cf FOREIGN KEY (fee_type_id)
  30. REFERENCES invoice_fee_type (id) MATCH SIMPLE
  31. ON UPDATE NO ACTION ON DELETE NO ACTION,
  32. CONSTRAINT fk_90651744318da063 FOREIGN KEY (invoiced_by_id)
  33. REFERENCES fos_user (id) MATCH SIMPLE
  34. ON UPDATE NO ACTION ON DELETE NO ACTION,
  35. CONSTRAINT fk_906517446bf700bd FOREIGN KEY (status_id)
  36. REFERENCES invoice_status (id) MATCH SIMPLE
  37. ON UPDATE NO ACTION ON DELETE NO ACTION,
  38. CONSTRAINT fk_90651744896dbbde FOREIGN KEY (updated_by_id)
  39. REFERENCES fos_user (id) MATCH SIMPLE
  40. ON UPDATE NO ACTION ON DELETE NO ACTION,
  41. CONSTRAINT fk_90651744979b1ad6 FOREIGN KEY (company_id)
  42. REFERENCES company (id) MATCH SIMPLE
  43. ON UPDATE NO ACTION ON DELETE NO ACTION,
  44. CONSTRAINT fk_906517449a34590f FOREIGN KEY (opportunity_id)
  45. REFERENCES opportunity (id) MATCH SIMPLE
  46. ON UPDATE NO ACTION ON DELETE NO ACTION,
  47. CONSTRAINT fk_90651744a76ed395 FOREIGN KEY (user_id)
  48. REFERENCES fos_user (id) MATCH SIMPLE
  49. ON UPDATE NO ACTION ON DELETE NO ACTION,
  50. CONSTRAINT fk_90651744ae80f5df FOREIGN KEY (department_id)
  51. REFERENCES department (id) MATCH SIMPLE
  52. ON UPDATE NO ACTION ON DELETE NO ACTION,
  53. CONSTRAINT fk_90651744b03a8386 FOREIGN KEY (created_by_id)
  54. REFERENCES fos_user (id) MATCH SIMPLE
  55. ON UPDATE NO ACTION ON DELETE NO ACTION,
  56. CONSTRAINT fk_90651744facb0b63 FOREIGN KEY (group_by_id)
  57. REFERENCES invoice_group_by (id) MATCH SIMPLE
  58. ON UPDATE NO ACTION ON DELETE NO ACTION
  59. )
  60. WITH (
  61. OIDS=FALSE
  62. );
  63. ALTER TABLE invoice
  64. OWNER TO sd4;
  65. COMMENT ON COLUMN invoice.search IS '(DC2Type:tsvector)';
  66.  
  67.  
  68. -- Index: idx_9065174426fa54cf
  69.  
  70. -- DROP INDEX idx_9065174426fa54cf;
  71.  
  72. CREATE INDEX idx_9065174426fa54cf
  73. ON invoice
  74. USING btree
  75. (fee_type_id );
  76.  
  77. -- Index: idx_906517442b36786b
  78.  
  79. -- DROP INDEX idx_906517442b36786b;
  80.  
  81. CREATE INDEX idx_906517442b36786b
  82. ON invoice
  83. USING btree
  84. (title COLLATE pg_catalog."default" );
  85.  
  86. -- Index: idx_90651744318da063
  87.  
  88. -- DROP INDEX idx_90651744318da063;
  89.  
  90. CREATE INDEX idx_90651744318da063
  91. ON invoice
  92. USING btree
  93. (invoiced_by_id );
  94.  
  95. -- Index: idx_906517446bf700bd
  96.  
  97. -- DROP INDEX idx_906517446bf700bd;
  98.  
  99. CREATE INDEX idx_906517446bf700bd
  100. ON invoice
  101. USING btree
  102. (status_id );
  103.  
  104. -- Index: idx_906517447a2119e3
  105.  
  106. -- DROP INDEX idx_906517447a2119e3;
  107.  
  108. CREATE INDEX idx_906517447a2119e3
  109. ON invoice
  110. USING btree
  111. (bill );
  112.  
  113. -- Index: idx_90651744896dbbde
  114.  
  115. -- DROP INDEX idx_90651744896dbbde;
  116.  
  117. CREATE INDEX idx_90651744896dbbde
  118. ON invoice
  119. USING btree
  120. (updated_by_id );
  121.  
  122. -- Index: idx_90651744979b1ad6
  123.  
  124. -- DROP INDEX idx_90651744979b1ad6;
  125.  
  126. CREATE INDEX idx_90651744979b1ad6
  127. ON invoice
  128. USING btree
  129. (company_id );
  130.  
  131. -- Index: idx_906517449a34590f
  132.  
  133. -- DROP INDEX idx_906517449a34590f;
  134.  
  135. CREATE INDEX idx_906517449a34590f
  136. ON invoice
  137. USING btree
  138. (opportunity_id );
  139.  
  140. -- Index: idx_90651744a76ed395
  141.  
  142. -- DROP INDEX idx_90651744a76ed395;
  143.  
  144. CREATE INDEX idx_90651744a76ed395
  145. ON invoice
  146. USING btree
  147. (user_id );
  148.  
  149. -- Index: idx_90651744ae80f5df
  150.  
  151. -- DROP INDEX idx_90651744ae80f5df;
  152.  
  153. CREATE INDEX idx_90651744ae80f5df
  154. ON invoice
  155. USING btree
  156. (department_id );
  157.  
  158. -- Index: idx_90651744b03a8386
  159.  
  160. -- DROP INDEX idx_90651744b03a8386;
  161.  
  162. CREATE INDEX idx_90651744b03a8386
  163. ON invoice
  164. USING btree
  165. (created_by_id );
  166.  
  167. -- Index: idx_90651744b23db7b8
  168.  
  169. -- DROP INDEX idx_90651744b23db7b8;
  170.  
  171. CREATE INDEX idx_90651744b23db7b8
  172. ON invoice
  173. USING btree
  174. (created );
  175.  
  176. -- Index: idx_90651744c69b96f7
  177.  
  178. -- DROP INDEX idx_90651744c69b96f7;
  179.  
  180. CREATE INDEX idx_90651744c69b96f7
  181. ON invoice
  182. USING btree
  183. (updated );
  184.  
  185. -- Index: idx_90651744eb3b4e33
  186.  
  187. -- DROP INDEX idx_90651744eb3b4e33;
  188.  
  189. CREATE INDEX idx_90651744eb3b4e33
  190. ON invoice
  191. USING btree
  192. (deleted );
  193.  
  194. -- Index: idx_90651744facb0b63
  195.  
  196. -- DROP INDEX idx_90651744facb0b63;
  197.  
  198. CREATE INDEX idx_90651744facb0b63
  199. ON invoice
  200. USING btree
  201. (group_by_id );
Advertisement
Add Comment
Please, Sign In to add comment