Model1.ssdl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Schema Namespace="Хранилище rewqModel" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
  3. <EntityType Name="Aircrafts">
  4. <Key>
  5. <PropertyRef Name="ID" />
  6. </Key>
  7. <Property Name="ID" Type="int" Nullable="false" />
  8. <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  9. <Property Name="MakeModel" Type="nvarchar" MaxLength="10" />
  10. <Property Name="TotalSeats" Type="int" Nullable="false" />
  11. <Property Name="EconomySeats" Type="int" Nullable="false" />
  12. <Property Name="BusinessSeats" Type="int" Nullable="false" />
  13. </EntityType>
  14. <EntityType Name="Airports">
  15. <Key>
  16. <PropertyRef Name="ID" />
  17. </Key>
  18. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  19. <Property Name="CountryID" Type="int" Nullable="false" />
  20. <Property Name="IATACode" Type="varchar" MaxLength="3" Nullable="false" />
  21. <Property Name="Name" Type="nvarchar" MaxLength="50" />
  22. </EntityType>
  23. <EntityType Name="CabinTypes">
  24. <Key>
  25. <PropertyRef Name="ID" />
  26. </Key>
  27. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  28. <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  29. </EntityType>
  30. <EntityType Name="Countries">
  31. <Key>
  32. <PropertyRef Name="ID" />
  33. </Key>
  34. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  35. <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  36. </EntityType>
  37. <EntityType Name="Offices">
  38. <Key>
  39. <PropertyRef Name="ID" />
  40. </Key>
  41. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  42. <Property Name="CountryID" Type="int" Nullable="false" />
  43. <Property Name="Title" Type="nvarchar" MaxLength="50" Nullable="false" />
  44. <Property Name="Phone" Type="nvarchar" MaxLength="50" Nullable="false" />
  45. <Property Name="Contact" Type="nvarchar" MaxLength="250" Nullable="false" />
  46. </EntityType>
  47. <EntityType Name="Roles">
  48. <Key>
  49. <PropertyRef Name="ID" />
  50. </Key>
  51. <Property Name="ID" Type="int" Nullable="false" />
  52. <Property Name="Title" Type="nvarchar" MaxLength="50" Nullable="false" />
  53. </EntityType>
  54. <EntityType Name="Routes">
  55. <Key>
  56. <PropertyRef Name="ID" />
  57. </Key>
  58. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  59. <Property Name="DepartureAirportID" Type="int" Nullable="false" />
  60. <Property Name="ArrivalAirportID" Type="int" Nullable="false" />
  61. <Property Name="Distance" Type="int" Nullable="false" />
  62. <Property Name="FlightTime" Type="int" Nullable="false" />
  63. </EntityType>
  64. <EntityType Name="Schedules">
  65. <Key>
  66. <PropertyRef Name="ID" />
  67. </Key>
  68. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  69. <Property Name="Date" Type="date" Nullable="false" />
  70. <Property Name="Time" Type="time" Precision="5" Nullable="false" />
  71. <Property Name="AircraftID" Type="int" Nullable="false" />
  72. <Property Name="RouteID" Type="int" Nullable="false" />
  73. <Property Name="EconomyPrice" Type="money" Nullable="false" />
  74. <Property Name="Confirmed" Type="bit" Nullable="false" />
  75. <Property Name="FlightNumber" Type="nvarchar" MaxLength="10" />
  76. </EntityType>
  77. <EntityType Name="Tickets">
  78. <Key>
  79. <PropertyRef Name="ID" />
  80. </Key>
  81. <Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  82. <Property Name="UserID" Type="int" Nullable="false" />
  83. <Property Name="ScheduleID" Type="int" Nullable="false" />
  84. <Property Name="CabinTypeID" Type="int" Nullable="false" />
  85. <Property Name="Firstname" Type="nvarchar" MaxLength="50" Nullable="false" />
  86. <Property Name="Lastname" Type="nvarchar" MaxLength="50" Nullable="false" />
  87. <Property Name="Email" Type="nvarchar" MaxLength="50" />
  88. <Property Name="Phone" Type="nvarchar" MaxLength="14" Nullable="false" />
  89. <Property Name="PassportNumber" Type="nvarchar" MaxLength="9" Nullable="false" />
  90. <Property Name="PassportCountryID" Type="int" Nullable="false" />
  91. <Property Name="BookingReference" Type="nvarchar" MaxLength="6" Nullable="false" />
  92. <Property Name="Confirmed" Type="bit" Nullable="false" />
  93. </EntityType>
  94. <EntityType Name="Users">
  95. <Key>
  96. <PropertyRef Name="ID" />
  97. </Key>
  98. <Property Name="ID" Type="int" Nullable="false" />
  99. <Property Name="RoleID" Type="int" Nullable="false" />
  100. <Property Name="Email" Type="nvarchar" MaxLength="150" Nullable="false" />
  101. <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
  102. <Property Name="FirstName" Type="nvarchar" MaxLength="50" />
  103. <Property Name="LastName" Type="nvarchar" MaxLength="50" Nullable="false" />
  104. <Property Name="OfficeID" Type="int" />
  105. <Property Name="Birthdate" Type="date" />
  106. <Property Name="Active" Type="bit" />
  107. </EntityType>
  108. <Association Name="FK_AirPort_Country">
  109. <End Role="Countries" Type="Self.Countries" Multiplicity="1" />
  110. <End Role="Airports" Type="Self.Airports" Multiplicity="*" />
  111. <ReferentialConstraint>
  112. <Principal Role="Countries">
  113. <PropertyRef Name="ID" />
  114. </Principal>
  115. <Dependent Role="Airports">
  116. <PropertyRef Name="CountryID" />
  117. </Dependent>
  118. </ReferentialConstraint>
  119. </Association>
  120. <Association Name="FK_Office_Country">
  121. <End Role="Countries" Type="Self.Countries" Multiplicity="1" />
  122. <End Role="Offices" Type="Self.Offices" Multiplicity="*" />
  123. <ReferentialConstraint>
  124. <Principal Role="Countries">
  125. <PropertyRef Name="ID" />
  126. </Principal>
  127. <Dependent Role="Offices">
  128. <PropertyRef Name="CountryID" />
  129. </Dependent>
  130. </ReferentialConstraint>
  131. </Association>
  132. <Association Name="FK_Routes_Airports2">
  133. <End Role="Airports" Type="Self.Airports" Multiplicity="1" />
  134. <End Role="Routes" Type="Self.Routes" Multiplicity="*" />
  135. <ReferentialConstraint>
  136. <Principal Role="Airports">
  137. <PropertyRef Name="ID" />
  138. </Principal>
  139. <Dependent Role="Routes">
  140. <PropertyRef Name="DepartureAirportID" />
  141. </Dependent>
  142. </ReferentialConstraint>
  143. </Association>
  144. <Association Name="FK_Routes_Airports3">
  145. <End Role="Airports" Type="Self.Airports" Multiplicity="1" />
  146. <End Role="Routes" Type="Self.Routes" Multiplicity="*" />
  147. <ReferentialConstraint>
  148. <Principal Role="Airports">
  149. <PropertyRef Name="ID" />
  150. </Principal>
  151. <Dependent Role="Routes">
  152. <PropertyRef Name="ArrivalAirportID" />
  153. </Dependent>
  154. </ReferentialConstraint>
  155. </Association>
  156. <Association Name="FK_Schedule_AirCraft">
  157. <End Role="Aircrafts" Type="Self.Aircrafts" Multiplicity="1" />
  158. <End Role="Schedules" Type="Self.Schedules" Multiplicity="*" />
  159. <ReferentialConstraint>
  160. <Principal Role="Aircrafts">
  161. <PropertyRef Name="ID" />
  162. </Principal>
  163. <Dependent Role="Schedules">
  164. <PropertyRef Name="AircraftID" />
  165. </Dependent>
  166. </ReferentialConstraint>
  167. </Association>
  168. <Association Name="FK_Schedule_Routes">
  169. <End Role="Routes" Type="Self.Routes" Multiplicity="1" />
  170. <End Role="Schedules" Type="Self.Schedules" Multiplicity="*" />
  171. <ReferentialConstraint>
  172. <Principal Role="Routes">
  173. <PropertyRef Name="ID" />
  174. </Principal>
  175. <Dependent Role="Schedules">
  176. <PropertyRef Name="RouteID" />
  177. </Dependent>
  178. </ReferentialConstraint>
  179. </Association>
  180. <Association Name="FK_Ticket_Schedule">
  181. <End Role="Schedules" Type="Self.Schedules" Multiplicity="1" />
  182. <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
  183. <ReferentialConstraint>
  184. <Principal Role="Schedules">
  185. <PropertyRef Name="ID" />
  186. </Principal>
  187. <Dependent Role="Tickets">
  188. <PropertyRef Name="ScheduleID" />
  189. </Dependent>
  190. </ReferentialConstraint>
  191. </Association>
  192. <Association Name="FK_Ticket_TravelClass">
  193. <End Role="CabinTypes" Type="Self.CabinTypes" Multiplicity="1" />
  194. <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
  195. <ReferentialConstraint>
  196. <Principal Role="CabinTypes">
  197. <PropertyRef Name="ID" />
  198. </Principal>
  199. <Dependent Role="Tickets">
  200. <PropertyRef Name="CabinTypeID" />
  201. </Dependent>
  202. </ReferentialConstraint>
  203. </Association>
  204. <Association Name="FK_Ticket_User">
  205. <End Role="Users" Type="Self.Users" Multiplicity="1" />
  206. <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
  207. <ReferentialConstraint>
  208. <Principal Role="Users">
  209. <PropertyRef Name="ID" />
  210. </Principal>
  211. <Dependent Role="Tickets">
  212. <PropertyRef Name="UserID" />
  213. </Dependent>
  214. </ReferentialConstraint>
  215. </Association>
  216. <Association Name="FK_Users_Offices">
  217. <End Role="Offices" Type="Self.Offices" Multiplicity="0..1" />
  218. <End Role="Users" Type="Self.Users" Multiplicity="*" />
  219. <ReferentialConstraint>
  220. <Principal Role="Offices">
  221. <PropertyRef Name="ID" />
  222. </Principal>
  223. <Dependent Role="Users">
  224. <PropertyRef Name="OfficeID" />
  225. </Dependent>
  226. </ReferentialConstraint>
  227. </Association>
  228. <Association Name="FK_Users_Roles">
  229. <End Role="Roles" Type="Self.Roles" Multiplicity="1" />
  230. <End Role="Users" Type="Self.Users" Multiplicity="*" />
  231. <ReferentialConstraint>
  232. <Principal Role="Roles">
  233. <PropertyRef Name="ID" />
  234. </Principal>
  235. <Dependent Role="Users">
  236. <PropertyRef Name="RoleID" />
  237. </Dependent>
  238. </ReferentialConstraint>
  239. </Association>
  240. <EntityContainer Name="Хранилище rewqModelContainer">
  241. <EntitySet Name="Aircrafts" EntityType="Self.Aircrafts" Schema="dbo" store:Type="Tables" />
  242. <EntitySet Name="Airports" EntityType="Self.Airports" Schema="dbo" store:Type="Tables" />
  243. <EntitySet Name="CabinTypes" EntityType="Self.CabinTypes" Schema="dbo" store:Type="Tables" />
  244. <EntitySet Name="Countries" EntityType="Self.Countries" Schema="dbo" store:Type="Tables" />
  245. <EntitySet Name="Offices" EntityType="Self.Offices" Schema="dbo" store:Type="Tables" />
  246. <EntitySet Name="Roles" EntityType="Self.Roles" Schema="dbo" store:Type="Tables" />
  247. <EntitySet Name="Routes" EntityType="Self.Routes" Schema="dbo" store:Type="Tables" />
  248. <EntitySet Name="Schedules" EntityType="Self.Schedules" Schema="dbo" store:Type="Tables" />
  249. <EntitySet Name="Tickets" EntityType="Self.Tickets" Schema="dbo" store:Type="Tables" />
  250. <EntitySet Name="Users" EntityType="Self.Users" Schema="dbo" store:Type="Tables" />
  251. <AssociationSet Name="FK_AirPort_Country" Association="Self.FK_AirPort_Country">
  252. <End Role="Countries" EntitySet="Countries" />
  253. <End Role="Airports" EntitySet="Airports" />
  254. </AssociationSet>
  255. <AssociationSet Name="FK_Office_Country" Association="Self.FK_Office_Country">
  256. <End Role="Countries" EntitySet="Countries" />
  257. <End Role="Offices" EntitySet="Offices" />
  258. </AssociationSet>
  259. <AssociationSet Name="FK_Routes_Airports2" Association="Self.FK_Routes_Airports2">
  260. <End Role="Airports" EntitySet="Airports" />
  261. <End Role="Routes" EntitySet="Routes" />
  262. </AssociationSet>
  263. <AssociationSet Name="FK_Routes_Airports3" Association="Self.FK_Routes_Airports3">
  264. <End Role="Airports" EntitySet="Airports" />
  265. <End Role="Routes" EntitySet="Routes" />
  266. </AssociationSet>
  267. <AssociationSet Name="FK_Schedule_AirCraft" Association="Self.FK_Schedule_AirCraft">
  268. <End Role="Aircrafts" EntitySet="Aircrafts" />
  269. <End Role="Schedules" EntitySet="Schedules" />
  270. </AssociationSet>
  271. <AssociationSet Name="FK_Schedule_Routes" Association="Self.FK_Schedule_Routes">
  272. <End Role="Routes" EntitySet="Routes" />
  273. <End Role="Schedules" EntitySet="Schedules" />
  274. </AssociationSet>
  275. <AssociationSet Name="FK_Ticket_Schedule" Association="Self.FK_Ticket_Schedule">
  276. <End Role="Schedules" EntitySet="Schedules" />
  277. <End Role="Tickets" EntitySet="Tickets" />
  278. </AssociationSet>
  279. <AssociationSet Name="FK_Ticket_TravelClass" Association="Self.FK_Ticket_TravelClass">
  280. <End Role="CabinTypes" EntitySet="CabinTypes" />
  281. <End Role="Tickets" EntitySet="Tickets" />
  282. </AssociationSet>
  283. <AssociationSet Name="FK_Ticket_User" Association="Self.FK_Ticket_User">
  284. <End Role="Users" EntitySet="Users" />
  285. <End Role="Tickets" EntitySet="Tickets" />
  286. </AssociationSet>
  287. <AssociationSet Name="FK_Users_Offices" Association="Self.FK_Users_Offices">
  288. <End Role="Offices" EntitySet="Offices" />
  289. <End Role="Users" EntitySet="Users" />
  290. </AssociationSet>
  291. <AssociationSet Name="FK_Users_Roles" Association="Self.FK_Users_Roles">
  292. <End Role="Roles" EntitySet="Roles" />
  293. <End Role="Users" EntitySet="Users" />
  294. </AssociationSet>
  295. </EntityContainer>
  296. </Schema>