activefacts-examples 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +10 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +22 -0
  8. data/Rakefile +6 -0
  9. data/activefacts-examples.gemspec +26 -0
  10. data/cql/Address.cql +44 -0
  11. data/cql/Astronomy.cql +35 -0
  12. data/cql/Blog.cql +54 -0
  13. data/cql/CinemaBookings.cql +64 -0
  14. data/cql/CinemaTickets.cql +127 -0
  15. data/cql/CompanyDirectorEmployee.cql +56 -0
  16. data/cql/Death.cql +17 -0
  17. data/cql/Diplomacy.cql +48 -0
  18. data/cql/Genealogy.cql +98 -0
  19. data/cql/Health.cql +78 -0
  20. data/cql/Insurance.cql +320 -0
  21. data/cql/Marriage.cql +18 -0
  22. data/cql/Metamodel.cql +567 -0
  23. data/cql/Monogamy.cql +24 -0
  24. data/cql/MultiInheritance.cql +22 -0
  25. data/cql/MultipleSubtyping.cql +30 -0
  26. data/cql/NonRoleId.cql +14 -0
  27. data/cql/OddIdentifier.cql +18 -0
  28. data/cql/OilSupply.cql +53 -0
  29. data/cql/OneRoleNesting.cql +38 -0
  30. data/cql/OneToOnes.cql +17 -0
  31. data/cql/Orienteering.cql +111 -0
  32. data/cql/PartyModel.cql +38 -0
  33. data/cql/PersonPlaysGame.cql +18 -0
  34. data/cql/RedundantDependency.cql +34 -0
  35. data/cql/SchoolActivities.cql +33 -0
  36. data/cql/SeparateSubtype.cql +30 -0
  37. data/cql/ServiceDirector.cql +276 -0
  38. data/cql/SimplestUnary.cql +12 -0
  39. data/cql/Supervision.cql +34 -0
  40. data/cql/VenueSeating.cql +45 -0
  41. data/cql/WaiterTips.cql +33 -0
  42. data/cql/Warehousing.cql +101 -0
  43. data/cql/WindowInRoomInBldg.cql +28 -0
  44. data/cql/unit.cql +474 -0
  45. data/diagrams/json/Address.json +41 -0
  46. data/diagrams/json/Astronomy.json +31 -0
  47. data/diagrams/json/Blog.json +46 -0
  48. data/diagrams/json/CinemaBookings.json +53 -0
  49. data/diagrams/json/CinemaTickets.json +101 -0
  50. data/diagrams/json/CompanyDirectorEmployee.json +44 -0
  51. data/diagrams/json/Death.json +20 -0
  52. data/diagrams/json/Diplomacy.json +34 -0
  53. data/diagrams/json/Genealogy.json +78 -0
  54. data/diagrams/json/Insurance.json +259 -0
  55. data/diagrams/json/Marriage.json +21 -0
  56. data/diagrams/json/Metamodel.json +318 -0
  57. data/diagrams/json/Monogamy.json +22 -0
  58. data/diagrams/json/MultiInheritance.json +25 -0
  59. data/diagrams/json/MultipleSubtyping.json +22 -0
  60. data/diagrams/json/OilSupply.json +49 -0
  61. data/diagrams/json/OneRoleNesting.json +37 -0
  62. data/diagrams/json/Orienteering.json +94 -0
  63. data/diagrams/json/PersonPlaysGame.json +22 -0
  64. data/diagrams/json/RedundantDependency.json +33 -0
  65. data/diagrams/json/SchoolActivities.json +28 -0
  66. data/diagrams/json/SeparateSubtype.json +29 -0
  67. data/diagrams/json/SimplestUnary.json +15 -0
  68. data/diagrams/json/Supervision.json +27 -0
  69. data/diagrams/json/VenueSeating.json +40 -0
  70. data/diagrams/json/WaiterTips.json +29 -0
  71. data/diagrams/json/Warehousing.json +86 -0
  72. data/diagrams/json/WindowInRoomInBldg.json +31 -0
  73. data/images/Address.SQL.png +0 -0
  74. data/images/Address.png +0 -0
  75. data/images/Blog.png +0 -0
  76. data/images/CinemaBookings.png +0 -0
  77. data/images/CinemaTickets.png +0 -0
  78. data/images/CompanyDirectorEmployee.png +0 -0
  79. data/images/Death.png +0 -0
  80. data/images/Diplomacy.png +0 -0
  81. data/images/DumpMetamodel.bat +2 -0
  82. data/images/Genealogy.png +0 -0
  83. data/images/Insurance/Claim.png +0 -0
  84. data/images/Insurance/Insurance.png +0 -0
  85. data/images/Insurance/Person.png +0 -0
  86. data/images/Insurance/Policy.png +0 -0
  87. data/images/Insurance/Related.png +0 -0
  88. data/images/Insurance/VehicleIncident.png +0 -0
  89. data/images/Marriage.png +0 -0
  90. data/images/Metamodel/Concepts.png +0 -0
  91. data/images/Metamodel/Constraints.png +0 -0
  92. data/images/Metamodel/ContextNote.png +0 -0
  93. data/images/Metamodel/Diagrams.png +0 -0
  94. data/images/Metamodel/Language.png +0 -0
  95. data/images/Metamodel/Legacy.png +0 -0
  96. data/images/Metamodel/Objects.png +0 -0
  97. data/images/Metamodel/Populations.png +0 -0
  98. data/images/Metamodel/Query.png +0 -0
  99. data/images/Metamodel/Units.png +0 -0
  100. data/images/Metamodel/ValueConstraints.png +0 -0
  101. data/images/Metamodel/ValueTypes.png +0 -0
  102. data/images/MetamodelER.bcp +1 -0
  103. data/images/MetamodelER.pdf +0 -0
  104. data/images/MultiInheritance.png +0 -0
  105. data/images/NorthwindER.png +0 -0
  106. data/images/OilSupply.png +0 -0
  107. data/images/Orienteering/Administration.png +0 -0
  108. data/images/Orienteering/Registration.png +0 -0
  109. data/images/Orienteering/Scoring.png +0 -0
  110. data/images/PersonPlaysGame.png +0 -0
  111. data/images/RedundantDependency.png +0 -0
  112. data/images/SchoolActivities.png +0 -0
  113. data/images/SeparateSubtype.png +0 -0
  114. data/images/SimplestUnary.png +0 -0
  115. data/images/Supervision.png +0 -0
  116. data/images/VenueSeating.png +0 -0
  117. data/images/WaiterTips.png +0 -0
  118. data/images/Warehousing.png +0 -0
  119. data/images/WindowInRoomInBldg.png +0 -0
  120. data/metadata/json/Astronomy.json +175 -0
  121. data/metadata/json/CinemaBookings.json +354 -0
  122. data/metadata/json/CinemaTickets.json +768 -0
  123. data/metadata/json/CompanyDirectorEmployee.json +270 -0
  124. data/metadata/json/Diplomacy.json +186 -0
  125. data/metadata/json/Metamodel.json +3214 -0
  126. data/metadata/json/OilSupply.json +411 -0
  127. data/metadata/json/SeparateSubtype.json +157 -0
  128. data/metadata/json/Supervision.json +128 -0
  129. data/metadata/json/VenueSeating.json +209 -0
  130. data/orm/.gitignore +11 -0
  131. data/orm/Address.orm +1268 -0
  132. data/orm/Astronomy.orm +925 -0
  133. data/orm/Blog.orm +1711 -0
  134. data/orm/CinemaBookings.orm +1998 -0
  135. data/orm/CinemaTickets.orm +5060 -0
  136. data/orm/CompanyDirectorEmployee.orm +2094 -0
  137. data/orm/Death.orm +386 -0
  138. data/orm/Diplomacy.orm +1478 -0
  139. data/orm/ExampleModels2010.csproj +764 -0
  140. data/orm/ExampleModels2010.sln +16 -0
  141. data/orm/Genealogy.orm +3209 -0
  142. data/orm/Health.orm +2407 -0
  143. data/orm/Insurance.orm +12727 -0
  144. data/orm/Marriage.orm +493 -0
  145. data/orm/Metamodel.orm +20998 -0
  146. data/orm/Monogamy.orm +328 -0
  147. data/orm/MultiInheritance.orm +537 -0
  148. data/orm/MultipleSubtyping.orm +347 -0
  149. data/orm/OilSupply.orm +2533 -0
  150. data/orm/OneRoleNesting.orm +1237 -0
  151. data/orm/Orienteering.orm +3976 -0
  152. data/orm/PersonPlaysGame.orm +426 -0
  153. data/orm/RedundantDependency.orm +844 -0
  154. data/orm/SchoolActivities.orm +961 -0
  155. data/orm/SeparateSubtype.orm +821 -0
  156. data/orm/SimplestUnary.orm +172 -0
  157. data/orm/Supervision.orm +734 -0
  158. data/orm/VenueSeating.orm +1289 -0
  159. data/orm/WaiterTips.orm +789 -0
  160. data/orm/Warehousing.orm +3792 -0
  161. data/orm/WindowInRoomInBldg.orm +772 -0
  162. data/rails/models/Astronomy.models +17 -0
  163. data/rails/models/CinemaBookings.models +123 -0
  164. data/rails/models/CinemaTickets.models +192 -0
  165. data/rails/models/Diplomacy.models +126 -0
  166. data/rails/models/Metamodel.models +894 -0
  167. data/rails/models/OneRoleNesting.models +18 -0
  168. data/rails/models/SeparateSubtype.models +49 -0
  169. data/rails/models/VenueSeating.models +70 -0
  170. data/rails/schema/Astronomy.schema.rb +25 -0
  171. data/rails/schema/CinemaBookings.schema.rb +78 -0
  172. data/rails/schema/CinemaTickets.schema.rb +132 -0
  173. data/rails/schema/Diplomacy.schema.rb +74 -0
  174. data/rails/schema/Metamodel.schema.rb +538 -0
  175. data/rails/schema/OneRoleNesting.rb +20 -0
  176. data/rails/schema/SeparateSubtype.schema.rb +35 -0
  177. data/rails/schema/VenueSeating.schema.rb +46 -0
  178. data/rails/schema/Warehousing.schema.rb +145 -0
  179. data/ruby/Address.rb +68 -0
  180. data/ruby/Astronomy.rb +55 -0
  181. data/ruby/Blog.rb +84 -0
  182. data/ruby/CinemaBookings.rb +109 -0
  183. data/ruby/CinemaTickets.rb +218 -0
  184. data/ruby/CompanyDirectorEmployee.rb +73 -0
  185. data/ruby/Death.rb +26 -0
  186. data/ruby/Diplomacy.rb +59 -0
  187. data/ruby/Genealogy.rb +173 -0
  188. data/ruby/Insurance.rb +562 -0
  189. data/ruby/Marriage.rb +21 -0
  190. data/ruby/Metamodel.rb +621 -0
  191. data/ruby/Monogamy.rb +27 -0
  192. data/ruby/MultiInheritance.rb +38 -0
  193. data/ruby/OilSupply.rb +112 -0
  194. data/ruby/OneRoleNesting.rb +66 -0
  195. data/ruby/Orienteering.rb +216 -0
  196. data/ruby/PersonPlaysGame.rb +31 -0
  197. data/ruby/RedundantDependency.rb +53 -0
  198. data/ruby/SchoolActivities.rb +49 -0
  199. data/ruby/SeparateSubtype.rb +46 -0
  200. data/ruby/SimplestUnary.rb +10 -0
  201. data/ruby/Supervision.rb +33 -0
  202. data/ruby/TwoValues.rb +14 -0
  203. data/ruby/VenueSeating.rb +64 -0
  204. data/ruby/WaiterTips.rb +49 -0
  205. data/ruby/Warehousing.rb +167 -0
  206. data/ruby/WindowInRoomInBldg.rb +45 -0
  207. data/sql/server/Address.sql +40 -0
  208. data/sql/server/Astronomy.sql +36 -0
  209. data/sql/server/Blog.sql +78 -0
  210. data/sql/server/CinemaBookings.sql +95 -0
  211. data/sql/server/CinemaTickets.sql +191 -0
  212. data/sql/server/CompanyDirectorEmployee.sql +104 -0
  213. data/sql/server/Death.sql +11 -0
  214. data/sql/server/Diplomacy.sql +66 -0
  215. data/sql/server/Genealogy.sql +138 -0
  216. data/sql/server/Health.sql +169 -0
  217. data/sql/server/Insurance.sql +484 -0
  218. data/sql/server/Marriage.sql +30 -0
  219. data/sql/server/Metamodel.sql +1000 -0
  220. data/sql/server/Monogamy.sql +20 -0
  221. data/sql/server/MultiInheritance.sql +27 -0
  222. data/sql/server/OilSupply.sql +105 -0
  223. data/sql/server/OneRoleNesting.sql +29 -0
  224. data/sql/server/Orienteering.sql +186 -0
  225. data/sql/server/PersonPlaysGame.sql +9 -0
  226. data/sql/server/RedundantDependency.sql +54 -0
  227. data/sql/server/SchoolActivities.sql +30 -0
  228. data/sql/server/SeparateSubtype.sql +33 -0
  229. data/sql/server/SimplestUnary.sql +9 -0
  230. data/sql/server/Supervision.sql +30 -0
  231. data/sql/server/VenueSeating.sql +54 -0
  232. data/sql/server/WaiterTips.sql +31 -0
  233. data/sql/server/Warehousing.sql +203 -0
  234. data/sql/server/WindowInRoomInBldg.sql +13 -0
  235. data/transform/surrogate/Address.absorption +2 -0
  236. data/transform/surrogate/Blog.absorption +5 -0
  237. data/transform/surrogate/CinemaBookings.absorption +7 -0
  238. data/transform/surrogate/CompanyDirectorEmployee.absorption +7 -0
  239. data/transform/surrogate/Death.absorption +1 -0
  240. data/transform/surrogate/Diplomacy-revised.absorption +6 -0
  241. data/transform/surrogate/Diplomacy.absorption +6 -0
  242. data/transform/surrogate/Genealogy.absorption +8 -0
  243. data/transform/surrogate/Insurance.absorption +18 -0
  244. data/transform/surrogate/Marriage.absorption +2 -0
  245. data/transform/surrogate/Metamodel.absorption +25 -0
  246. data/transform/surrogate/Monogamy.absorption +1 -0
  247. data/transform/surrogate/MultiInheritance.absorption +1 -0
  248. data/transform/surrogate/MultipleSubtyping.absorption +1 -0
  249. data/transform/surrogate/OilSupply.absorption +8 -0
  250. data/transform/surrogate/OneRoleNesting.absorption +1 -0
  251. data/transform/surrogate/Orienteering.absorption +11 -0
  252. data/transform/surrogate/PersonPlaysGame.absorption +1 -0
  253. data/transform/surrogate/RedundantDependency.absorption +3 -0
  254. data/transform/surrogate/SchoolActivities.absorption +3 -0
  255. data/transform/surrogate/SeparateSubtype.absorption +3 -0
  256. data/transform/surrogate/SimplestUnary.absorption +1 -0
  257. data/transform/surrogate/Supervision.absorption +2 -0
  258. data/transform/surrogate/WaiterTips.absorption +3 -0
  259. data/transform/surrogate/Warehousing.absorption +12 -0
  260. data/transform/surrogate/WindowInRoomInBldg.absorption +1 -0
  261. data/transform/surrogate/unit.absorption +0 -0
  262. metadata +374 -0
@@ -0,0 +1,538 @@
1
+ #
2
+ # schema.rb auto-generated using ActiveFacts for Metamodel on 2015-10-08
3
+ #
4
+
5
+ ActiveRecord::Base.logger = Logger.new(STDOUT)
6
+ ActiveRecord::Schema.define(:version => 20151008133030) do
7
+ enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
8
+ create_table "aggregations", :id => false, :force => true do |t|
9
+ t.column "aggregation_id", :primary_key, :null => false
10
+ t.column "aggregated_variable_id", :integer, :null => false
11
+ t.column "variable_id", :integer, :null => false
12
+ t.column "aggregate_code", :string, :limit => 32, :null => false
13
+ end
14
+
15
+ add_index "aggregations", ["aggregate_code", "aggregated_variable_id"], :name => :index_aggregations_on_aggregate_code_aggregated_variable_id, :unique => true
16
+
17
+ create_table "allowed_ranges", :id => false, :force => true do |t|
18
+ t.column "allowed_range_id", :primary_key, :null => false
19
+ t.column "value_constraint_concept_guid", :uuid, :null => false
20
+ t.column "value_range_maximum_bound_is_inclusive", :boolean, :null => true
21
+ t.column "value_range_maximum_bound_value_id", :integer, :null => true
22
+ t.column "value_range_minimum_bound_is_inclusive", :boolean, :null => true
23
+ t.column "value_range_minimum_bound_value_id", :integer, :null => true
24
+ end
25
+
26
+ add_index "allowed_ranges", ["value_constraint_concept_guid", "value_range_minimum_bound_value_id", "value_range_minimum_bound_is_inclusive", "value_range_maximum_bound_value_id", "value_range_maximum_bound_is_inclusive"], :name => :index_allowed_ranges_on_value_constraint_concept_guid__27f61618
27
+
28
+ create_table "alternative_sets", :id => false, :force => true do |t|
29
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
30
+ t.column "members_are_exclusive", :boolean, :null => true
31
+ end
32
+
33
+
34
+ create_table "components", :id => false, :force => true do |t|
35
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
36
+ t.column "mapping_guid", :uuid, :null => true
37
+ t.column "absorption_child_role_id", :integer, :null => true
38
+ t.column "absorption_flattens", :boolean, :null => true
39
+ t.column "absorption_index_role_id", :integer, :null => true
40
+ t.column "absorption_parent_role_id", :integer, :null => true
41
+ t.column "indicator_role_id", :integer, :null => true
42
+ t.column "mapping_composition_guid", :uuid, :null => true
43
+ t.column "mapping_object_type_id", :integer, :null => true
44
+ t.column "name", :string, :limit => 64, :null => true
45
+ end
46
+
47
+
48
+ create_table "compositions", :id => false, :force => true do |t|
49
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
50
+ t.column "name", :string, :limit => 64, :null => false
51
+ end
52
+
53
+ add_index "compositions", ["name"], :name => :index_compositions_on_name, :unique => true
54
+
55
+ create_table "concepts", :id => false, :force => true do |t|
56
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
57
+ t.column "context_note_date", :datetime, :null => true
58
+ t.column "context_note_discussion", :string, :null => true
59
+ t.column "context_note_kind", :string, :null => true
60
+ t.column "context_note_relevant_concept_guid", :uuid, :null => true
61
+ t.column "fact_population_id", :integer, :null => true
62
+ t.column "fact_type_concept_guid", :uuid, :null => true
63
+ t.column "implication_rule_name", :string, :null => true
64
+ t.column "instance_fact_concept_guid", :uuid, :null => true
65
+ t.column "instance_object_type_id", :integer, :null => true
66
+ t.column "instance_population_id", :integer, :null => true
67
+ t.column "instance_value_id", :integer, :null => true
68
+ t.column "topic_name", :string, :limit => 64, :null => true
69
+ t.column "unit_coefficient_denominator", :integer, :limit => 32, :null => true
70
+ t.column "unit_coefficient_is_precise", :boolean, :null => true
71
+ t.column "unit_coefficient_numerator", :decimal, :null => true
72
+ t.column "unit_ephemera_url", :string, :null => true
73
+ t.column "unit_is_fundamental", :boolean, :null => true
74
+ t.column "unit_name", :string, :limit => 64, :null => true
75
+ t.column "unit_offset", :decimal, :null => true
76
+ t.column "unit_plural_name", :string, :limit => 64, :null => true
77
+ t.column "unit_vocabulary_name", :string, :limit => 64, :null => true
78
+ end
79
+
80
+ add_index "concepts", ["instance_fact_concept_guid"], :name => :index_concepts_on_instance_fact_concept_guid
81
+ add_index "concepts", ["unit_name"], :name => :index_concepts_on_unit_name
82
+ add_index "concepts", ["unit_plural_name"], :name => :index_concepts_on_unit_plural_name
83
+ add_index "concepts", ["unit_vocabulary_name", "unit_name"], :name => :index_concepts_on_unit_vocabulary_name_unit_name
84
+
85
+ create_table "concept_annotations", :id => false, :force => true do |t|
86
+ t.column "concept_annotation_id", :primary_key, :null => false
87
+ t.column "concept_guid", :uuid, :null => false
88
+ t.column "mapping_annotation", :string, :null => false
89
+ end
90
+
91
+ add_index "concept_annotations", ["concept_guid", "mapping_annotation"], :name => :index_concept_annotations_on_concept_guid_mapping_annotation, :unique => true
92
+
93
+ create_table "constraints", :id => false, :force => true do |t|
94
+ t.column "concept_guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
95
+ t.column "enforcement_agent_name", :string, :null => true
96
+ t.column "enforcement_code", :string, :limit => 16, :null => true
97
+ t.column "name", :string, :limit => 64, :null => true
98
+ t.column "presence_constraint_is_mandatory", :boolean, :null => true
99
+ t.column "presence_constraint_is_preferred_identifier", :boolean, :null => true
100
+ t.column "presence_constraint_max_frequency", :integer, :limit => 32, :null => true
101
+ t.column "presence_constraint_min_frequency", :integer, :limit => 32, :null => true
102
+ t.column "presence_constraint_role_sequence_guid", :uuid, :null => true
103
+ t.column "ring_constraint_other_role_id", :integer, :null => true
104
+ t.column "ring_constraint_ring_type", :string, :null => true
105
+ t.column "ring_constraint_role_id", :integer, :null => true
106
+ t.column "set_exclusion_constraint_is_mandatory", :boolean, :null => true
107
+ t.column "subset_constraint_subset_role_sequence_guid", :uuid, :null => true
108
+ t.column "subset_constraint_superset_role_sequence_guid", :uuid, :null => true
109
+ t.column "value_constraint_regular_expression", :string, :null => true
110
+ t.column "value_constraint_role_id", :integer, :null => true
111
+ t.column "vocabulary_name", :string, :limit => 64, :null => true
112
+ end
113
+
114
+ add_index "constraints", ["enforcement_agent_name", "enforcement_code"], :name => :index_constraints_on_enforcement_agent_name_enforcement_code
115
+ add_index "constraints", ["subset_constraint_subset_role_sequence_guid", "subset_constraint_superset_role_sequence_guid"], :name => :index_constraints_on_subset_constraint_subset_role_se__e3672973
116
+ add_index "constraints", ["value_constraint_role_id"], :name => :index_constraints_on_value_constraint_role_id
117
+ add_index "constraints", ["vocabulary_name", "name"], :name => :index_constraints_on_vocabulary_name_name
118
+
119
+ create_table "context_according_tos", :id => false, :force => true do |t|
120
+ t.column "context_according_to_id", :primary_key, :null => false
121
+ t.column "context_note_concept_guid", :uuid, :null => false
122
+ t.column "agent_name", :string, :null => false
123
+ t.column "date", :datetime, :null => true
124
+ end
125
+
126
+ add_index "context_according_tos", ["context_note_concept_guid", "agent_name"], :name => :index_context_according_tos_on_context_note_concept_g__19dd27b8, :unique => true
127
+
128
+ create_table "context_agreed_bies", :id => false, :force => true do |t|
129
+ t.column "context_agreed_by_id", :primary_key, :null => false
130
+ t.column "agreement_context_note_concept_guid", :uuid, :null => false
131
+ t.column "agent_name", :string, :null => false
132
+ end
133
+
134
+ add_index "context_agreed_bies", ["agreement_context_note_concept_guid", "agent_name"], :name => :index_context_agreed_bies_on_agreement_context_note_c__7f25bff2, :unique => true
135
+
136
+ create_table "derivations", :id => false, :force => true do |t|
137
+ t.column "derivation_id", :primary_key, :null => false
138
+ t.column "base_unit_concept_guid", :uuid, :null => false
139
+ t.column "derived_unit_concept_guid", :uuid, :null => false
140
+ t.column "exponent", :integer, :limit => 16, :null => true
141
+ end
142
+
143
+ add_index "derivations", ["derived_unit_concept_guid", "base_unit_concept_guid"], :name => :index_derivations_on_derived_unit_concept_guid_base_u__a3406667, :unique => true
144
+
145
+ create_table "diagrams", :id => false, :force => true do |t|
146
+ t.column "diagram_id", :primary_key, :null => false
147
+ t.column "name", :string, :limit => 64, :null => false
148
+ t.column "vocabulary_name", :string, :limit => 64, :null => false
149
+ end
150
+
151
+ add_index "diagrams", ["vocabulary_name", "name"], :name => :index_diagrams_on_vocabulary_name_name, :unique => true
152
+
153
+ create_table "discriminated_roles", :id => false, :force => true do |t|
154
+ t.column "discriminated_role_id", :primary_key, :null => false
155
+ t.column "discriminator_guid", :uuid, :null => false
156
+ t.column "role_id", :integer, :null => false
157
+ t.column "value_id", :integer, :null => false
158
+ end
159
+
160
+ add_index "discriminated_roles", ["discriminator_guid", "role_id"], :name => :index_discriminated_roles_on_discriminator_guid_role_id, :unique => true
161
+ add_index "discriminated_roles", ["discriminator_guid", "value_id"], :name => :index_discriminated_roles_on_discriminator_guid_value_id, :unique => true
162
+
163
+ create_table "fact_types", :id => false, :force => true do |t|
164
+ t.column "concept_guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
165
+ t.column "entity_type_object_type_id", :integer, :null => true
166
+ t.column "type_inheritance_assimilation", :string, :null => true
167
+ t.column "type_inheritance_provides_identification", :boolean, :null => true
168
+ t.column "type_inheritance_subtype_object_type_id", :integer, :null => true
169
+ t.column "type_inheritance_supertype_object_type_id", :integer, :null => true
170
+ end
171
+
172
+ add_index "fact_types", ["entity_type_object_type_id"], :name => :index_fact_types_on_entity_type_object_type_id
173
+ add_index "fact_types", ["type_inheritance_subtype_object_type_id", "type_inheritance_provides_identification"], :name => :index_fact_types_on_type_inheritance_subtype_object_t__04417c92
174
+ add_index "fact_types", ["type_inheritance_subtype_object_type_id", "type_inheritance_supertype_object_type_id"], :name => :index_fact_types_on_type_inheritance_subtype_object_t__9c8eded7
175
+
176
+ create_table "object_types", :id => false, :force => true do |t|
177
+ t.column "object_type_id", :primary_key, :null => false
178
+ t.column "concept_guid", :uuid, :null => false
179
+ t.column "is_independent", :boolean, :null => true
180
+ t.column "name", :string, :limit => 64, :null => false
181
+ t.column "pronoun", :string, :limit => 20, :null => true
182
+ t.column "value_type_length", :integer, :limit => 32, :null => true
183
+ t.column "value_type_scale", :integer, :limit => 32, :null => true
184
+ t.column "value_type_supertype_object_type_id", :integer, :null => true
185
+ t.column "value_type_transaction_phase", :string, :null => true
186
+ t.column "value_type_unit_concept_guid", :uuid, :null => true
187
+ t.column "value_type_value_constraint_concept_guid", :uuid, :null => true
188
+ t.column "vocabulary_name", :string, :limit => 64, :null => false
189
+ end
190
+
191
+ add_index "object_types", ["concept_guid"], :name => :index_object_types_on_concept_guid, :unique => true
192
+ add_index "object_types", ["value_type_length", "value_type_scale", "value_type_supertype_object_type_id", "value_type_transaction_phase", "value_type_unit_concept_guid", "value_type_value_constraint_concept_guid"], :name => :index_object_types_on_value_type_length_value_type_sc__bb56328c
193
+ add_index "object_types", ["value_type_value_constraint_concept_guid"], :name => :index_object_types_on_value_type_value_constraint_concept_guid
194
+ add_index "object_types", ["vocabulary_name", "name"], :name => :index_object_types_on_vocabulary_name_name, :unique => true
195
+
196
+ create_table "plays", :id => false, :force => true do |t|
197
+ t.column "play_id", :primary_key, :null => false
198
+ t.column "role_id", :integer, :null => false
199
+ t.column "step_guid", :uuid, :null => false
200
+ t.column "variable_id", :integer, :null => false
201
+ t.column "is_input", :boolean, :null => true
202
+ end
203
+
204
+ add_index "plays", ["step_guid", "role_id"], :name => :index_plays_on_step_guid_role_id, :unique => true
205
+
206
+ create_table "populations", :id => false, :force => true do |t|
207
+ t.column "population_id", :primary_key, :null => false
208
+ t.column "concept_guid", :uuid, :null => false
209
+ t.column "name", :string, :limit => 64, :null => false
210
+ t.column "vocabulary_name", :string, :limit => 64, :null => true
211
+ end
212
+
213
+ add_index "populations", ["concept_guid"], :name => :index_populations_on_concept_guid, :unique => true
214
+ add_index "populations", ["vocabulary_name", "name"], :name => :index_populations_on_vocabulary_name_name
215
+
216
+ create_table "readings", :id => false, :force => true do |t|
217
+ t.column "reading_id", :primary_key, :null => false
218
+ t.column "fact_type_concept_guid", :uuid, :null => false
219
+ t.column "role_sequence_guid", :uuid, :null => false
220
+ t.column "is_negative", :boolean, :null => true
221
+ t.column "ordinal", :integer, :limit => 16, :null => false
222
+ t.column "text", :string, :limit => 256, :null => false
223
+ end
224
+
225
+ add_index "readings", ["fact_type_concept_guid", "ordinal"], :name => :index_readings_on_fact_type_concept_guid_ordinal, :unique => true
226
+
227
+ create_table "roles", :id => false, :force => true do |t|
228
+ t.column "role_id", :primary_key, :null => false
229
+ t.column "concept_guid", :uuid, :null => false
230
+ t.column "fact_type_concept_guid", :uuid, :null => false
231
+ t.column "link_fact_type_concept_guid", :uuid, :null => true
232
+ t.column "object_type_id", :integer, :null => false
233
+ t.column "ordinal", :integer, :limit => 16, :null => false
234
+ t.column "role_name", :string, :limit => 64, :null => true
235
+ end
236
+
237
+ add_index "roles", ["concept_guid"], :name => :index_roles_on_concept_guid, :unique => true
238
+ add_index "roles", ["fact_type_concept_guid", "ordinal"], :name => :index_roles_on_fact_type_concept_guid_ordinal, :unique => true
239
+ add_index "roles", ["link_fact_type_concept_guid"], :name => :index_roles_on_link_fact_type_concept_guid
240
+
241
+ create_table "role_displays", :id => false, :force => true do |t|
242
+ t.column "role_display_id", :primary_key, :null => false
243
+ t.column "fact_type_shape_guid", :uuid, :null => false
244
+ t.column "role_id", :integer, :null => false
245
+ t.column "ordinal", :integer, :limit => 16, :null => false
246
+ end
247
+
248
+ add_index "role_displays", ["fact_type_shape_guid", "ordinal"], :name => :index_role_displays_on_fact_type_shape_guid_ordinal, :unique => true
249
+
250
+ create_table "role_refs", :id => false, :force => true do |t|
251
+ t.column "role_ref_id", :primary_key, :null => false
252
+ t.column "play_id", :integer, :null => true
253
+ t.column "role_id", :integer, :null => false
254
+ t.column "role_sequence_guid", :uuid, :null => false
255
+ t.column "leading_adjective", :string, :limit => 64, :null => true
256
+ t.column "ordinal", :integer, :limit => 16, :null => false
257
+ t.column "trailing_adjective", :string, :limit => 64, :null => true
258
+ end
259
+
260
+ add_index "role_refs", ["play_id"], :name => :index_role_refs_on_play_id
261
+ add_index "role_refs", ["role_id", "role_sequence_guid"], :name => :index_role_refs_on_role_id_role_sequence_guid, :unique => true
262
+ add_index "role_refs", ["role_sequence_guid", "ordinal"], :name => :index_role_refs_on_role_sequence_guid_ordinal, :unique => true
263
+
264
+ create_table "role_sequences", :id => false, :force => true do |t|
265
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
266
+ t.column "has_unused_dependency_to_force_table_in_norma", :boolean, :null => true
267
+ end
268
+
269
+
270
+ create_table "role_values", :id => false, :force => true do |t|
271
+ t.column "role_value_id", :primary_key, :null => false
272
+ t.column "fact_concept_guid", :uuid, :null => false
273
+ t.column "instance_concept_guid", :uuid, :null => false
274
+ t.column "population_id", :integer, :null => false
275
+ t.column "role_id", :integer, :null => false
276
+ end
277
+
278
+ add_index "role_values", ["fact_concept_guid", "role_id"], :name => :index_role_values_on_fact_concept_guid_role_id, :unique => true
279
+
280
+ create_table "set_comparison_roles", :id => false, :force => true do |t|
281
+ t.column "set_comparison_roles_id", :primary_key, :null => false
282
+ t.column "role_sequence_guid", :uuid, :null => false
283
+ t.column "set_comparison_constraint_concept_guid", :uuid, :null => false
284
+ t.column "ordinal", :integer, :limit => 16, :null => false
285
+ end
286
+
287
+ add_index "set_comparison_roles", ["set_comparison_constraint_concept_guid", "ordinal"], :name => :index_set_comparison_roles_on_set_comparison_constrai__5dea248f, :unique => true
288
+ add_index "set_comparison_roles", ["set_comparison_constraint_concept_guid", "role_sequence_guid"], :name => :index_set_comparison_roles_on_set_comparison_constrai__619ed890, :unique => true
289
+
290
+ create_table "shapes", :id => false, :force => true do |t|
291
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
292
+ t.column "orm_diagram_id", :integer, :null => false
293
+ t.column "constraint_shape_constraint_concept_guid", :uuid, :null => true
294
+ t.column "fact_type_shape_display_role_names_setting", :string, :null => true
295
+ t.column "fact_type_shape_fact_type_concept_guid", :uuid, :null => true
296
+ t.column "fact_type_shape_rotation_setting", :string, :null => true
297
+ t.column "is_expanded", :boolean, :null => true
298
+ t.column "location_x", :integer, :limit => 32, :null => true
299
+ t.column "location_y", :integer, :limit => 32, :null => true
300
+ t.column "model_note_shape_context_note_concept_guid", :uuid, :null => true
301
+ t.column "object_type_shape_has_expanded_reference_mode", :boolean, :null => true
302
+ t.column "object_type_shape_object_type_id", :integer, :null => true
303
+ t.column "objectified_fact_type_name_shape_fact_type_shape_guid", :uuid, :null => true
304
+ t.column "reading_shape_fact_type_shape_guid", :uuid, :null => true
305
+ t.column "reading_shape_reading_id", :integer, :null => true
306
+ t.column "ring_constraint_shape_fact_type_shape_guid", :uuid, :null => true
307
+ t.column "role_name_shape_role_display_id", :integer, :null => true
308
+ t.column "value_constraint_shape_object_type_shape_guid", :uuid, :null => true
309
+ t.column "value_constraint_shape_role_display_id", :integer, :null => true
310
+ end
311
+
312
+ add_index "shapes", ["orm_diagram_id", "location_x", "location_y"], :name => :index_shapes_on_orm_diagram_id_location_x_location_y
313
+ add_index "shapes", ["objectified_fact_type_name_shape_fact_type_shape_guid"], :name => :index_shapes_on_objectified_fact_type_name_shape_fact__12ad8c9b
314
+ add_index "shapes", ["reading_shape_fact_type_shape_guid"], :name => :index_shapes_on_reading_shape_fact_type_shape_guid
315
+ add_index "shapes", ["role_name_shape_role_display_id"], :name => :index_shapes_on_role_name_shape_role_display_id
316
+ add_index "shapes", ["value_constraint_shape_role_display_id"], :name => :index_shapes_on_value_constraint_shape_role_display_id
317
+
318
+ create_table "steps", :id => false, :force => true do |t|
319
+ t.column "guid", :uuid, :default => 'gen_random_uuid()', :primary_key => true, :null => false
320
+ t.column "alternative_set_guid", :uuid, :null => true
321
+ t.column "fact_type_concept_guid", :uuid, :null => false
322
+ t.column "is_disallowed", :boolean, :null => true
323
+ t.column "is_optional", :boolean, :null => true
324
+ end
325
+
326
+
327
+ create_table "values", :id => false, :force => true do |t|
328
+ t.column "value_id", :primary_key, :null => false
329
+ t.column "unit_concept_guid", :uuid, :null => true
330
+ t.column "value_type_object_type_id", :integer, :null => false
331
+ t.column "is_literal_string", :boolean, :null => true
332
+ t.column "literal", :string, :null => false
333
+ end
334
+
335
+ add_index "values", ["literal", "is_literal_string", "unit_concept_guid"], :name => :index_values_on_literal_is_literal_string_unit_concept_guid
336
+
337
+ create_table "value_type_parameters", :id => false, :force => true do |t|
338
+ t.column "value_type_parameter_id", :primary_key, :null => false
339
+ t.column "facet_value_type_object_type_id", :integer, :null => false
340
+ t.column "value_type_object_type_id", :integer, :null => false
341
+ t.column "name", :string, :limit => 64, :null => false
342
+ end
343
+
344
+ add_index "value_type_parameters", ["value_type_object_type_id", "name"], :name => :index_value_type_parameters_on_value_type_object_type_id_name, :unique => true
345
+
346
+ create_table "value_type_parameter_restrictions", :id => false, :force => true do |t|
347
+ t.column "value_type_parameter_restriction_id", :primary_key, :null => false
348
+ t.column "value_id", :integer, :null => false
349
+ t.column "value_type_object_type_id", :integer, :null => false
350
+ t.column "value_type_parameter_id", :integer, :null => false
351
+ end
352
+
353
+ add_index "value_type_parameter_restrictions", ["value_type_object_type_id", "value_type_parameter_id"], :name => :index_value_type_parameter_restrictions_on_value_type__cc84c559, :unique => true
354
+
355
+ create_table "variables", :id => false, :force => true do |t|
356
+ t.column "variable_id", :primary_key, :null => false
357
+ t.column "object_type_id", :integer, :null => false
358
+ t.column "projection_id", :integer, :null => true
359
+ t.column "query_concept_guid", :uuid, :null => false
360
+ t.column "step_guid", :uuid, :null => true
361
+ t.column "value_id", :integer, :null => true
362
+ t.column "ordinal", :integer, :limit => 16, :null => false
363
+ t.column "role_name", :string, :limit => 64, :null => true
364
+ t.column "subscript", :integer, :limit => 16, :null => true
365
+ end
366
+
367
+ add_index "variables", ["projection_id"], :name => :index_variables_on_projection_id
368
+ add_index "variables", ["query_concept_guid", "ordinal"], :name => :index_variables_on_query_concept_guid_ordinal, :unique => true
369
+ add_index "variables", ["step_guid"], :name => :index_variables_on_step_guid
370
+
371
+ unless ENV["EXCLUDE_FKS"]
372
+ add_foreign_key :aggregations, :variables, :column => :aggregated_variable_id, :primary_key => :variable_id, :on_delete => :cascade
373
+ add_index :aggregations, [:aggregated_variable_id], :unique => false, :name => :index_aggregations_on_aggregated_variable_id
374
+ add_foreign_key :aggregations, :variables, :column => :variable_id, :primary_key => :variable_id, :on_delete => :cascade
375
+ add_index :aggregations, [:variable_id], :unique => false, :name => :index_aggregations_on_variable_id
376
+ add_foreign_key :allowed_ranges, :constraints, :column => :value_constraint_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
377
+ add_index :allowed_ranges, [:value_constraint_concept_guid], :unique => false, :name => :index_allowed_ranges_on_value_constraint_concept_guid
378
+ add_foreign_key :allowed_ranges, :values, :column => :value_range_maximum_bound_value_id, :primary_key => :value_id, :on_delete => :cascade
379
+ add_index :allowed_ranges, [:value_range_maximum_bound_value_id], :unique => false, :name => :index_allowed_ranges_on_value_range_maximum_bound_value_id
380
+ add_foreign_key :allowed_ranges, :values, :column => :value_range_minimum_bound_value_id, :primary_key => :value_id, :on_delete => :cascade
381
+ add_index :allowed_ranges, [:value_range_minimum_bound_value_id], :unique => false, :name => :index_allowed_ranges_on_value_range_minimum_bound_value_id
382
+ add_foreign_key :components, :components, :column => :mapping_guid, :primary_key => :guid, :on_delete => :cascade
383
+ add_index :components, [:mapping_guid], :unique => false, :name => :index_components_on_mapping_guid
384
+ add_foreign_key :components, :compositions, :column => :mapping_composition_guid, :primary_key => :guid, :on_delete => :cascade
385
+ add_index :components, [:mapping_composition_guid], :unique => false, :name => :index_components_on_mapping_composition_guid
386
+ add_foreign_key :components, :object_types, :column => :mapping_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
387
+ add_index :components, [:mapping_object_type_id], :unique => false, :name => :index_components_on_mapping_object_type_id
388
+ add_foreign_key :components, :roles, :column => :absorption_child_role_id, :primary_key => :role_id, :on_delete => :cascade
389
+ add_index :components, [:absorption_child_role_id], :unique => false, :name => :index_components_on_absorption_child_role_id
390
+ add_foreign_key :components, :roles, :column => :absorption_index_role_id, :primary_key => :role_id, :on_delete => :cascade
391
+ add_index :components, [:absorption_index_role_id], :unique => false, :name => :index_components_on_absorption_index_role_id
392
+ add_foreign_key :components, :roles, :column => :absorption_parent_role_id, :primary_key => :role_id, :on_delete => :cascade
393
+ add_index :components, [:absorption_parent_role_id], :unique => false, :name => :index_components_on_absorption_parent_role_id
394
+ add_foreign_key :components, :roles, :column => :indicator_role_id, :primary_key => :role_id, :on_delete => :cascade
395
+ add_index :components, [:indicator_role_id], :unique => false, :name => :index_components_on_indicator_role_id
396
+ add_foreign_key :concepts, :concepts, :column => :context_note_relevant_concept_guid, :primary_key => :guid, :on_delete => :cascade
397
+ add_index :concepts, [:context_note_relevant_concept_guid], :unique => false, :name => :index_concepts_on_context_note_relevant_concept_guid
398
+ add_foreign_key :concepts, :concepts, :column => :instance_fact_concept_guid, :primary_key => :guid, :on_delete => :cascade
399
+ add_foreign_key :concepts, :fact_types, :column => :fact_type_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
400
+ add_index :concepts, [:fact_type_concept_guid], :unique => false, :name => :index_concepts_on_fact_type_concept_guid
401
+ add_foreign_key :concepts, :object_types, :column => :instance_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
402
+ add_index :concepts, [:instance_object_type_id], :unique => false, :name => :index_concepts_on_instance_object_type_id
403
+ add_foreign_key :concepts, :populations, :column => :fact_population_id, :primary_key => :population_id, :on_delete => :cascade
404
+ add_index :concepts, [:fact_population_id], :unique => false, :name => :index_concepts_on_fact_population_id
405
+ add_foreign_key :concepts, :populations, :column => :instance_population_id, :primary_key => :population_id, :on_delete => :cascade
406
+ add_index :concepts, [:instance_population_id], :unique => false, :name => :index_concepts_on_instance_population_id
407
+ add_foreign_key :concepts, :values, :column => :instance_value_id, :primary_key => :value_id, :on_delete => :cascade
408
+ add_index :concepts, [:instance_value_id], :unique => false, :name => :index_concepts_on_instance_value_id
409
+ add_foreign_key :concept_annotations, :concepts, :column => :concept_guid, :primary_key => :guid, :on_delete => :cascade
410
+ add_index :concept_annotations, [:concept_guid], :unique => false, :name => :index_concept_annotations_on_concept_guid
411
+ add_foreign_key :constraints, :concepts, :column => :concept_guid, :primary_key => :guid, :on_delete => :cascade
412
+ add_foreign_key :constraints, :roles, :column => :ring_constraint_other_role_id, :primary_key => :role_id, :on_delete => :cascade
413
+ add_index :constraints, [:ring_constraint_other_role_id], :unique => false, :name => :index_constraints_on_ring_constraint_other_role_id
414
+ add_foreign_key :constraints, :roles, :column => :ring_constraint_role_id, :primary_key => :role_id, :on_delete => :cascade
415
+ add_index :constraints, [:ring_constraint_role_id], :unique => false, :name => :index_constraints_on_ring_constraint_role_id
416
+ add_foreign_key :constraints, :roles, :column => :value_constraint_role_id, :primary_key => :role_id, :on_delete => :cascade
417
+ add_foreign_key :constraints, :role_sequences, :column => :presence_constraint_role_sequence_guid, :primary_key => :guid, :on_delete => :cascade
418
+ add_index :constraints, [:presence_constraint_role_sequence_guid], :unique => false, :name => :index_constraints_on_presence_constraint_role_sequence_guid
419
+ add_foreign_key :constraints, :role_sequences, :column => :subset_constraint_subset_role_sequence_guid, :primary_key => :guid, :on_delete => :cascade
420
+ add_index :constraints, [:subset_constraint_subset_role_sequence_guid], :unique => false, :name => :index_constraints_on_subset_constraint_subset_role_se__39bdd75f
421
+ add_foreign_key :constraints, :role_sequences, :column => :subset_constraint_superset_role_sequence_guid, :primary_key => :guid, :on_delete => :cascade
422
+ add_index :constraints, [:subset_constraint_superset_role_sequence_guid], :unique => false, :name => :index_constraints_on_subset_constraint_superset_role___de8fcd63
423
+ add_foreign_key :context_according_tos, :concepts, :column => :context_note_concept_guid, :primary_key => :guid, :on_delete => :cascade
424
+ add_index :context_according_tos, [:context_note_concept_guid], :unique => false, :name => :index_context_according_tos_on_context_note_concept_guid
425
+ add_foreign_key :context_agreed_bies, :concepts, :column => :agreement_context_note_concept_guid, :primary_key => :guid, :on_delete => :cascade
426
+ add_index :context_agreed_bies, [:agreement_context_note_concept_guid], :unique => false, :name => :index_context_agreed_bies_on_agreement_context_note_c__b36b03bb
427
+ add_foreign_key :derivations, :concepts, :column => :base_unit_concept_guid, :primary_key => :guid, :on_delete => :cascade
428
+ add_index :derivations, [:base_unit_concept_guid], :unique => false, :name => :index_derivations_on_base_unit_concept_guid
429
+ add_foreign_key :derivations, :concepts, :column => :derived_unit_concept_guid, :primary_key => :guid, :on_delete => :cascade
430
+ add_index :derivations, [:derived_unit_concept_guid], :unique => false, :name => :index_derivations_on_derived_unit_concept_guid
431
+ add_foreign_key :discriminated_roles, :components, :column => :discriminator_guid, :primary_key => :guid, :on_delete => :cascade
432
+ add_index :discriminated_roles, [:discriminator_guid], :unique => false, :name => :index_discriminated_roles_on_discriminator_guid
433
+ add_foreign_key :discriminated_roles, :roles, :column => :role_id, :primary_key => :role_id, :on_delete => :cascade
434
+ add_index :discriminated_roles, [:role_id], :unique => false, :name => :index_discriminated_roles_on_role_id
435
+ add_foreign_key :discriminated_roles, :values, :column => :value_id, :primary_key => :value_id, :on_delete => :cascade
436
+ add_index :discriminated_roles, [:value_id], :unique => false, :name => :index_discriminated_roles_on_value_id
437
+ add_foreign_key :fact_types, :concepts, :column => :concept_guid, :primary_key => :guid, :on_delete => :cascade
438
+ add_index :fact_types, [:concept_guid], :unique => false, :name => :index_fact_types_on_concept_guid
439
+ add_foreign_key :fact_types, :object_types, :column => :entity_type_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
440
+ add_foreign_key :fact_types, :object_types, :column => :type_inheritance_subtype_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
441
+ add_index :fact_types, [:type_inheritance_subtype_object_type_id], :unique => false, :name => :index_fact_types_on_type_inheritance_subtype_object_type_id
442
+ add_foreign_key :fact_types, :object_types, :column => :type_inheritance_supertype_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
443
+ add_index :fact_types, [:type_inheritance_supertype_object_type_id], :unique => false, :name => :index_fact_types_on_type_inheritance_supertype_object_type_id
444
+ add_foreign_key :object_types, :concepts, :column => :concept_guid, :primary_key => :guid, :on_delete => :cascade
445
+ add_foreign_key :object_types, :concepts, :column => :value_type_unit_concept_guid, :primary_key => :guid, :on_delete => :cascade
446
+ add_index :object_types, [:value_type_unit_concept_guid], :unique => false, :name => :index_object_types_on_value_type_unit_concept_guid
447
+ add_foreign_key :object_types, :constraints, :column => :value_type_value_constraint_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
448
+ add_index :object_types, [:value_type_value_constraint_concept_guid], :unique => false, :name => :index_object_types_on_value_type_value_constraint_concept_guid
449
+ add_foreign_key :object_types, :object_types, :column => :value_type_supertype_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
450
+ add_index :object_types, [:value_type_supertype_object_type_id], :unique => false, :name => :index_object_types_on_value_type_supertype_object_type_id
451
+ add_foreign_key :plays, :roles, :column => :role_id, :primary_key => :role_id, :on_delete => :cascade
452
+ add_index :plays, [:role_id], :unique => false, :name => :index_plays_on_role_id
453
+ add_foreign_key :plays, :steps, :column => :step_guid, :primary_key => :guid, :on_delete => :cascade
454
+ add_index :plays, [:step_guid], :unique => false, :name => :index_plays_on_step_guid
455
+ add_foreign_key :plays, :variables, :column => :variable_id, :primary_key => :variable_id, :on_delete => :cascade
456
+ add_index :plays, [:variable_id], :unique => false, :name => :index_plays_on_variable_id
457
+ add_foreign_key :populations, :concepts, :column => :concept_guid, :primary_key => :guid, :on_delete => :cascade
458
+ add_index :populations, [:concept_guid], :unique => false, :name => :index_populations_on_concept_guid
459
+ add_foreign_key :readings, :fact_types, :column => :fact_type_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
460
+ add_index :readings, [:fact_type_concept_guid], :unique => false, :name => :index_readings_on_fact_type_concept_guid
461
+ add_foreign_key :readings, :role_sequences, :column => :role_sequence_guid, :primary_key => :guid, :on_delete => :cascade
462
+ add_index :readings, [:role_sequence_guid], :unique => false, :name => :index_readings_on_role_sequence_guid
463
+ add_foreign_key :roles, :concepts, :column => :concept_guid, :primary_key => :guid, :on_delete => :cascade
464
+ add_index :roles, [:concept_guid], :unique => false, :name => :index_roles_on_concept_guid
465
+ add_foreign_key :roles, :fact_types, :column => :link_fact_type_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
466
+ add_foreign_key :roles, :fact_types, :column => :fact_type_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
467
+ add_index :roles, [:fact_type_concept_guid], :unique => false, :name => :index_roles_on_fact_type_concept_guid
468
+ add_foreign_key :roles, :object_types, :column => :object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
469
+ add_index :roles, [:object_type_id], :unique => false, :name => :index_roles_on_object_type_id
470
+ add_foreign_key :role_displays, :roles, :column => :role_id, :primary_key => :role_id, :on_delete => :cascade
471
+ add_index :role_displays, [:role_id], :unique => false, :name => :index_role_displays_on_role_id
472
+ add_foreign_key :role_displays, :shapes, :column => :fact_type_shape_guid, :primary_key => :guid, :on_delete => :cascade
473
+ add_index :role_displays, [:fact_type_shape_guid], :unique => false, :name => :index_role_displays_on_fact_type_shape_guid
474
+ add_foreign_key :role_refs, :plays, :column => :play_id, :primary_key => :play_id, :on_delete => :cascade
475
+ add_foreign_key :role_refs, :roles, :column => :role_id, :primary_key => :role_id, :on_delete => :cascade
476
+ add_index :role_refs, [:role_id], :unique => false, :name => :index_role_refs_on_role_id
477
+ add_foreign_key :role_refs, :role_sequences, :column => :role_sequence_guid, :primary_key => :guid, :on_delete => :cascade
478
+ add_index :role_refs, [:role_sequence_guid], :unique => false, :name => :index_role_refs_on_role_sequence_guid
479
+ add_foreign_key :role_values, :concepts, :column => :fact_concept_guid, :primary_key => :guid, :on_delete => :cascade
480
+ add_index :role_values, [:fact_concept_guid], :unique => false, :name => :index_role_values_on_fact_concept_guid
481
+ add_foreign_key :role_values, :concepts, :column => :instance_concept_guid, :primary_key => :guid, :on_delete => :cascade
482
+ add_index :role_values, [:instance_concept_guid], :unique => false, :name => :index_role_values_on_instance_concept_guid
483
+ add_foreign_key :role_values, :populations, :column => :population_id, :primary_key => :population_id, :on_delete => :cascade
484
+ add_index :role_values, [:population_id], :unique => false, :name => :index_role_values_on_population_id
485
+ add_foreign_key :role_values, :roles, :column => :role_id, :primary_key => :role_id, :on_delete => :cascade
486
+ add_index :role_values, [:role_id], :unique => false, :name => :index_role_values_on_role_id
487
+ add_foreign_key :set_comparison_roles, :constraints, :column => :set_comparison_constraint_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
488
+ add_index :set_comparison_roles, [:set_comparison_constraint_concept_guid], :unique => false, :name => :index_set_comparison_roles_on_set_comparison_constrai__66c96563
489
+ add_foreign_key :set_comparison_roles, :role_sequences, :column => :role_sequence_guid, :primary_key => :guid, :on_delete => :cascade
490
+ add_index :set_comparison_roles, [:role_sequence_guid], :unique => false, :name => :index_set_comparison_roles_on_role_sequence_guid
491
+ add_foreign_key :shapes, :concepts, :column => :model_note_shape_context_note_concept_guid, :primary_key => :guid, :on_delete => :cascade
492
+ add_index :shapes, [:model_note_shape_context_note_concept_guid], :unique => false, :name => :index_shapes_on_model_note_shape_context_note_concept_guid
493
+ add_foreign_key :shapes, :constraints, :column => :constraint_shape_constraint_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
494
+ add_index :shapes, [:constraint_shape_constraint_concept_guid], :unique => false, :name => :index_shapes_on_constraint_shape_constraint_concept_guid
495
+ add_foreign_key :shapes, :diagrams, :column => :orm_diagram_id, :primary_key => :diagram_id, :on_delete => :cascade
496
+ add_index :shapes, [:orm_diagram_id], :unique => false, :name => :index_shapes_on_orm_diagram_id
497
+ add_foreign_key :shapes, :fact_types, :column => :fact_type_shape_fact_type_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
498
+ add_index :shapes, [:fact_type_shape_fact_type_concept_guid], :unique => false, :name => :index_shapes_on_fact_type_shape_fact_type_concept_guid
499
+ add_foreign_key :shapes, :object_types, :column => :object_type_shape_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
500
+ add_index :shapes, [:object_type_shape_object_type_id], :unique => false, :name => :index_shapes_on_object_type_shape_object_type_id
501
+ add_foreign_key :shapes, :readings, :column => :reading_shape_reading_id, :primary_key => :reading_id, :on_delete => :cascade
502
+ add_index :shapes, [:reading_shape_reading_id], :unique => false, :name => :index_shapes_on_reading_shape_reading_id
503
+ add_foreign_key :shapes, :role_displays, :column => :value_constraint_shape_role_display_id, :primary_key => :role_display_id, :on_delete => :cascade
504
+ add_foreign_key :shapes, :role_displays, :column => :role_name_shape_role_display_id, :primary_key => :role_display_id, :on_delete => :cascade
505
+ add_foreign_key :shapes, :shapes, :column => :ring_constraint_shape_fact_type_shape_guid, :primary_key => :guid, :on_delete => :cascade
506
+ add_index :shapes, [:ring_constraint_shape_fact_type_shape_guid], :unique => false, :name => :index_shapes_on_ring_constraint_shape_fact_type_shape_guid
507
+ add_foreign_key :shapes, :shapes, :column => :value_constraint_shape_object_type_shape_guid, :primary_key => :guid, :on_delete => :cascade
508
+ add_index :shapes, [:value_constraint_shape_object_type_shape_guid], :unique => false, :name => :index_shapes_on_value_constraint_shape_object_type_shape_guid
509
+ add_foreign_key :shapes, :shapes, :column => :objectified_fact_type_name_shape_fact_type_shape_guid, :primary_key => :guid, :on_delete => :cascade
510
+ add_foreign_key :shapes, :shapes, :column => :reading_shape_fact_type_shape_guid, :primary_key => :guid, :on_delete => :cascade
511
+ add_foreign_key :steps, :alternative_sets, :column => :alternative_set_guid, :primary_key => :guid, :on_delete => :cascade
512
+ add_index :steps, [:alternative_set_guid], :unique => false, :name => :index_steps_on_alternative_set_guid
513
+ add_foreign_key :steps, :fact_types, :column => :fact_type_concept_guid, :primary_key => :concept_guid, :on_delete => :cascade
514
+ add_index :steps, [:fact_type_concept_guid], :unique => false, :name => :index_steps_on_fact_type_concept_guid
515
+ add_foreign_key :values, :concepts, :column => :unit_concept_guid, :primary_key => :guid, :on_delete => :cascade
516
+ add_index :values, [:unit_concept_guid], :unique => false, :name => :index_values_on_unit_concept_guid
517
+ add_foreign_key :values, :object_types, :column => :value_type_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
518
+ add_index :values, [:value_type_object_type_id], :unique => false, :name => :index_values_on_value_type_object_type_id
519
+ add_foreign_key :value_type_parameters, :object_types, :column => :facet_value_type_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
520
+ add_index :value_type_parameters, [:facet_value_type_object_type_id], :unique => false, :name => :index_value_type_parameters_on_facet_value_type_object_type_id
521
+ add_foreign_key :value_type_parameters, :object_types, :column => :value_type_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
522
+ add_index :value_type_parameters, [:value_type_object_type_id], :unique => false, :name => :index_value_type_parameters_on_value_type_object_type_id
523
+ add_foreign_key :value_type_parameter_restrictions, :object_types, :column => :value_type_object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
524
+ add_index :value_type_parameter_restrictions, [:value_type_object_type_id], :unique => false, :name => :index_value_type_parameter_restrictions_on_value_type__b7a98d4f
525
+ add_foreign_key :value_type_parameter_restrictions, :values, :column => :value_id, :primary_key => :value_id, :on_delete => :cascade
526
+ add_index :value_type_parameter_restrictions, [:value_id], :unique => false, :name => :index_value_type_parameter_restrictions_on_value_id
527
+ add_foreign_key :value_type_parameter_restrictions, :value_type_parameters, :column => :value_type_parameter_id, :primary_key => :value_type_parameter_id, :on_delete => :cascade
528
+ add_index :value_type_parameter_restrictions, [:value_type_parameter_id], :unique => false, :name => :index_value_type_parameter_restrictions_on_value_type__1aed154e
529
+ add_foreign_key :variables, :concepts, :column => :query_concept_guid, :primary_key => :guid, :on_delete => :cascade
530
+ add_index :variables, [:query_concept_guid], :unique => false, :name => :index_variables_on_query_concept_guid
531
+ add_foreign_key :variables, :object_types, :column => :object_type_id, :primary_key => :object_type_id, :on_delete => :cascade
532
+ add_index :variables, [:object_type_id], :unique => false, :name => :index_variables_on_object_type_id
533
+ add_foreign_key :variables, :roles, :column => :projection_id, :primary_key => :role_id, :on_delete => :cascade
534
+ add_foreign_key :variables, :steps, :column => :step_guid, :primary_key => :guid, :on_delete => :cascade
535
+ add_foreign_key :variables, :values, :column => :value_id, :primary_key => :value_id, :on_delete => :cascade
536
+ add_index :variables, [:value_id], :unique => false, :name => :index_variables_on_value_id
537
+ end
538
+ end
@@ -0,0 +1,20 @@
1
+ #
2
+ # schema.rb auto-generated using ActiveFacts for ORMModel1 on 2013-04-30
3
+ #
4
+
5
+ ActiveRecord::Schema.define(:version => 20130430120829) do
6
+ create_table "parties", :primary_key => :party_id, :force => true do |t|
7
+ t.integer "party_moniker_accuracy_level", :null => false
8
+ t.string "party_moniker_party_name", :null => false
9
+ t.integer "person_attending_doctor_id"
10
+ t.datetime "person_death_event_date_ymd"
11
+ t.boolean "person_died"
12
+ t.datetime "person_event_date_ymd"
13
+ end
14
+
15
+ add_index "parties", ["person_attending_doctor_id", "person_event_date_ymd"], :name => :index_parties_on_person_attending_doctor_id_person_ev__88d8d475
16
+
17
+ unless ENV["EXCLUDE_FKS"]
18
+ add_foreign_key :parties, :parties, :column => :person_attending_doctor_id, :primary_key => :party_id, :dependent => :cascade
19
+ end
20
+ end
@@ -0,0 +1,35 @@
1
+ #
2
+ # schema.rb auto-generated using ActiveFacts for SeparateSubtype on 2015-07-08
3
+ #
4
+
5
+ ActiveRecord::Base.logger = Logger.new(STDOUT)
6
+ ActiveRecord::Schema.define(:version => 20150708011603) do
7
+ enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
8
+ create_table "claims", :id => false, :force => true do |t|
9
+ t.column "claim_id", :primary_key, :null => false
10
+ t.column "incident_date_time", :datetime, :null => true
11
+ t.column "incident_witness_id", :integer, :null => true
12
+ end
13
+
14
+
15
+ create_table "people", :id => false, :force => true do |t|
16
+ t.column "person_id", :primary_key, :null => false
17
+ t.column "person_name", :string, :null => false
18
+ end
19
+
20
+ add_index "people", ["person_name"], :name => :index_people_on_person_name, :unique => true
21
+
22
+ create_table "vehicle_incidents", :id => false, :force => true do |t|
23
+ t.column "incident_claim_id", :primary_key, :null => false
24
+ t.column "driver_id", :integer, :null => true
25
+ end
26
+
27
+
28
+ unless ENV["EXCLUDE_FKS"]
29
+ add_foreign_key :claims, :people, :column => :incident_witness_id, :primary_key => :person_id, :on_delete => :cascade
30
+ add_index :claims, [:incident_witness_id], :unique => false, :name => :index_claims_on_incident_witness_id
31
+ add_foreign_key :vehicle_incidents, :claims, :column => :incident_claim_id, :primary_key => :claim_id, :on_delete => :cascade
32
+ add_foreign_key :vehicle_incidents, :people, :column => :driver_id, :primary_key => :person_id, :on_delete => :cascade
33
+ add_index :vehicle_incidents, [:driver_id], :unique => false, :name => :index_vehicle_incidents_on_driver_id
34
+ end
35
+ end