BaseModel.ssdl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Schema Namespace="Хранилище KarpovTuriModel" 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="Country">
  4. <Key>
  5. <PropertyRef Name="id_country" />
  6. </Key>
  7. <Property Name="id_country" Type="nchar" MaxLength="2" Nullable="false" />
  8. <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
  9. </EntityType>
  10. <EntityType Name="Hotel">
  11. <Key>
  12. <PropertyRef Name="id_hotel" />
  13. </Key>
  14. <Property Name="id_hotel" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  15. <Property Name="Name" Type="nvarchar" MaxLength="100" Nullable="false" />
  16. <Property Name="CountOfStars" Type="int" Nullable="false" />
  17. <Property Name="id_country" Type="nchar" MaxLength="2" Nullable="false" />
  18. </EntityType>
  19. <EntityType Name="HotelComment">
  20. <Key>
  21. <PropertyRef Name="Id_com" />
  22. </Key>
  23. <Property Name="Id_com" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  24. <Property Name="id_hotel" Type="int" Nullable="false" />
  25. <Property Name="Text" Type="nvarchar(max)" Nullable="false" />
  26. <Property Name="Author" Type="nvarchar" MaxLength="100" Nullable="false" />
  27. <Property Name="CreationDate" Type="datetime" Nullable="false" />
  28. </EntityType>
  29. <EntityType Name="HotelImage">
  30. <Key>
  31. <PropertyRef Name="id_img" />
  32. </Key>
  33. <Property Name="id_img" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  34. <Property Name="id_hotel" Type="int" Nullable="false" />
  35. <Property Name="ImageSource" Type="varbinary(max)" Nullable="false" />
  36. </EntityType>
  37. <EntityType Name="HotelOfTour">
  38. <Key>
  39. <PropertyRef Name="id_hotel" />
  40. <PropertyRef Name="id_tour" />
  41. </Key>
  42. <Property Name="id_hotel" Type="int" Nullable="false" />
  43. <Property Name="id_tour" Type="int" Nullable="false" />
  44. </EntityType>
  45. <EntityType Name="sysdiagrams">
  46. <Key>
  47. <PropertyRef Name="diagram_id" />
  48. </Key>
  49. <Property Name="name" Type="nvarchar" MaxLength="128" Nullable="false" />
  50. <Property Name="principal_id" Type="int" Nullable="false" />
  51. <Property Name="diagram_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  52. <Property Name="version" Type="int" />
  53. <Property Name="definition" Type="varbinary(max)" />
  54. </EntityType>
  55. <EntityType Name="Tour">
  56. <Key>
  57. <PropertyRef Name="id_tour" />
  58. </Key>
  59. <Property Name="id_tour" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  60. <Property Name="TicketNum" Type="int" Nullable="false" />
  61. <Property Name="Name" Type="nvarchar" MaxLength="100" Nullable="false" />
  62. <Property Name="Description" Type="nvarchar(max)" />
  63. <Property Name="ImagePreview" Type="varbinary(max)" />
  64. <Property Name="Price" Type="money" Nullable="false" />
  65. <Property Name="IsActual" Type="bit" Nullable="false" />
  66. </EntityType>
  67. <EntityType Name="Type">
  68. <Key>
  69. <PropertyRef Name="id_type" />
  70. </Key>
  71. <Property Name="id_type" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
  72. <Property Name="Name" Type="nvarchar" MaxLength="100" Nullable="false" />
  73. <Property Name="Description" Type="nvarchar(max)" />
  74. </EntityType>
  75. <EntityType Name="TypeOfTour">
  76. <Key>
  77. <PropertyRef Name="id_tour" />
  78. <PropertyRef Name="id_type" />
  79. </Key>
  80. <Property Name="id_tour" Type="int" Nullable="false" />
  81. <Property Name="id_type" Type="int" Nullable="false" />
  82. </EntityType>
  83. <!--Ошибки, обнаруженные при создании:
  84. предупреждение 6002: В таблице или представлении "KarpovTuri.dbo.Count_hotel" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  85. <EntityType Name="Count_hotel">
  86. <Key>
  87. <PropertyRef Name="Название отеля" />
  88. <PropertyRef Name="Количество звёзд" />
  89. <PropertyRef Name="Страна" />
  90. </Key>
  91. <Property Name="Название отеля" Type="nvarchar" MaxLength="50" Nullable="false" />
  92. <Property Name="Количество звёзд" Type="int" Nullable="false" />
  93. <Property Name="Страна" Type="nvarchar" MaxLength="100" Nullable="false" />
  94. </EntityType>
  95. <!--Ошибки, обнаруженные при создании:
  96. предупреждение 6002: В таблице или представлении "KarpovTuri.dbo.Description" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  97. <EntityType Name="Description">
  98. <Key>
  99. <PropertyRef Name="Название тура" />
  100. <PropertyRef Name="Цена" />
  101. <PropertyRef Name="Тип" />
  102. </Key>
  103. <Property Name="Название тура" Type="nvarchar" MaxLength="100" Nullable="false" />
  104. <Property Name="Превью" Type="varbinary(max)" />
  105. <Property Name="Цена" Type="money" Nullable="false" />
  106. <Property Name="Тип" Type="nvarchar" MaxLength="100" Nullable="false" />
  107. <Property Name="Описание" Type="nvarchar(max)" />
  108. </EntityType>
  109. <!--Ошибки, обнаруженные при создании:
  110. предупреждение 6002: В таблице или представлении "KarpovTuri.dbo.Hotel_Desc" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  111. <EntityType Name="Hotel_Desc">
  112. <Key>
  113. <PropertyRef Name="Название отеля" />
  114. <PropertyRef Name="Картинка" />
  115. <PropertyRef Name="Автор" />
  116. <PropertyRef Name="Описание" />
  117. </Key>
  118. <Property Name="Название отеля" Type="nvarchar" MaxLength="100" Nullable="false" />
  119. <Property Name="Картинка" Type="varbinary(max)" Nullable="false" />
  120. <Property Name="Автор" Type="nvarchar" MaxLength="100" Nullable="false" />
  121. <Property Name="Описание" Type="nvarchar(max)" Nullable="false" />
  122. </EntityType>
  123. <!--Ошибки, обнаруженные при создании:
  124. предупреждение 6002: В таблице или представлении "KarpovTuri.dbo.TourView" не определен первичный ключ. Ключ был выведен, а определение таблицы или представления было создано в режиме только для чтения.-->
  125. <EntityType Name="TourView">
  126. <Key>
  127. <PropertyRef Name="Название страны" />
  128. <PropertyRef Name="Название отеля" />
  129. <PropertyRef Name="Количество звёзд" />
  130. <PropertyRef Name="Номер билета" />
  131. <PropertyRef Name="Название тура" />
  132. <PropertyRef Name="Цена" />
  133. <PropertyRef Name="Актуальность" />
  134. <PropertyRef Name="Тип тура" />
  135. </Key>
  136. <Property Name="Название страны" Type="nvarchar" MaxLength="50" Nullable="false" />
  137. <Property Name="Название отеля" Type="nvarchar" MaxLength="100" Nullable="false" />
  138. <Property Name="Количество звёзд" Type="int" Nullable="false" />
  139. <Property Name="Номер билета" Type="int" Nullable="false" />
  140. <Property Name="Название тура" Type="nvarchar" MaxLength="100" Nullable="false" />
  141. <Property Name="Превью" Type="varbinary(max)" />
  142. <Property Name="Цена" Type="money" Nullable="false" />
  143. <Property Name="Актуальность" Type="bit" Nullable="false" />
  144. <Property Name="Тип тура" Type="nvarchar" MaxLength="100" Nullable="false" />
  145. <Property Name="Описание" Type="nvarchar(max)" />
  146. </EntityType>
  147. <Association Name="FK_Hotel_Country">
  148. <End Role="Country" Type="Self.Country" Multiplicity="1" />
  149. <End Role="Hotel" Type="Self.Hotel" Multiplicity="*" />
  150. <ReferentialConstraint>
  151. <Principal Role="Country">
  152. <PropertyRef Name="id_country" />
  153. </Principal>
  154. <Dependent Role="Hotel">
  155. <PropertyRef Name="id_country" />
  156. </Dependent>
  157. </ReferentialConstraint>
  158. </Association>
  159. <Association Name="FK_HotelComment_Hotel">
  160. <End Role="Hotel" Type="Self.Hotel" Multiplicity="1" />
  161. <End Role="HotelComment" Type="Self.HotelComment" Multiplicity="*" />
  162. <ReferentialConstraint>
  163. <Principal Role="Hotel">
  164. <PropertyRef Name="id_hotel" />
  165. </Principal>
  166. <Dependent Role="HotelComment">
  167. <PropertyRef Name="id_hotel" />
  168. </Dependent>
  169. </ReferentialConstraint>
  170. </Association>
  171. <Association Name="FK_HotelImage_Hotel">
  172. <End Role="Hotel" Type="Self.Hotel" Multiplicity="1" />
  173. <End Role="HotelImage" Type="Self.HotelImage" Multiplicity="*" />
  174. <ReferentialConstraint>
  175. <Principal Role="Hotel">
  176. <PropertyRef Name="id_hotel" />
  177. </Principal>
  178. <Dependent Role="HotelImage">
  179. <PropertyRef Name="id_hotel" />
  180. </Dependent>
  181. </ReferentialConstraint>
  182. </Association>
  183. <Association Name="FK_HotelOfTour_Hotel">
  184. <End Role="Hotel" Type="Self.Hotel" Multiplicity="1" />
  185. <End Role="HotelOfTour" Type="Self.HotelOfTour" Multiplicity="*" />
  186. <ReferentialConstraint>
  187. <Principal Role="Hotel">
  188. <PropertyRef Name="id_hotel" />
  189. </Principal>
  190. <Dependent Role="HotelOfTour">
  191. <PropertyRef Name="id_hotel" />
  192. </Dependent>
  193. </ReferentialConstraint>
  194. </Association>
  195. <Association Name="FK_HotelOfTour_Tour">
  196. <End Role="Tour" Type="Self.Tour" Multiplicity="1" />
  197. <End Role="HotelOfTour" Type="Self.HotelOfTour" Multiplicity="*" />
  198. <ReferentialConstraint>
  199. <Principal Role="Tour">
  200. <PropertyRef Name="id_tour" />
  201. </Principal>
  202. <Dependent Role="HotelOfTour">
  203. <PropertyRef Name="id_tour" />
  204. </Dependent>
  205. </ReferentialConstraint>
  206. </Association>
  207. <Association Name="FK_TypeOfTour_Tour">
  208. <End Role="Tour" Type="Self.Tour" Multiplicity="1" />
  209. <End Role="TypeOfTour" Type="Self.TypeOfTour" Multiplicity="*" />
  210. <ReferentialConstraint>
  211. <Principal Role="Tour">
  212. <PropertyRef Name="id_tour" />
  213. </Principal>
  214. <Dependent Role="TypeOfTour">
  215. <PropertyRef Name="id_tour" />
  216. </Dependent>
  217. </ReferentialConstraint>
  218. </Association>
  219. <Association Name="FK_TypeOfTour_Type">
  220. <End Role="Type" Type="Self.Type" Multiplicity="1" />
  221. <End Role="TypeOfTour" Type="Self.TypeOfTour" Multiplicity="*" />
  222. <ReferentialConstraint>
  223. <Principal Role="Type">
  224. <PropertyRef Name="id_type" />
  225. </Principal>
  226. <Dependent Role="TypeOfTour">
  227. <PropertyRef Name="id_type" />
  228. </Dependent>
  229. </ReferentialConstraint>
  230. </Association>
  231. <Function Name="fn_diagramobjects" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" ReturnType="int" />
  232. <Function Name="sp_alterdiagram" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  233. <Parameter Name="diagramname" Type="nvarchar" Mode="In" />
  234. <Parameter Name="owner_id" Type="int" Mode="In" />
  235. <Parameter Name="version" Type="int" Mode="In" />
  236. <Parameter Name="definition" Type="varbinary(max)" Mode="In" />
  237. </Function>
  238. <Function Name="sp_creatediagram" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  239. <Parameter Name="diagramname" Type="nvarchar" Mode="In" />
  240. <Parameter Name="owner_id" Type="int" Mode="In" />
  241. <Parameter Name="version" Type="int" Mode="In" />
  242. <Parameter Name="definition" Type="varbinary(max)" Mode="In" />
  243. </Function>
  244. <Function Name="sp_dropdiagram" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  245. <Parameter Name="diagramname" Type="nvarchar" Mode="In" />
  246. <Parameter Name="owner_id" Type="int" Mode="In" />
  247. </Function>
  248. <Function Name="sp_helpdiagramdefinition" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  249. <Parameter Name="diagramname" Type="nvarchar" Mode="In" />
  250. <Parameter Name="owner_id" Type="int" Mode="In" />
  251. </Function>
  252. <Function Name="sp_helpdiagrams" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  253. <Parameter Name="diagramname" Type="nvarchar" Mode="In" />
  254. <Parameter Name="owner_id" Type="int" Mode="In" />
  255. </Function>
  256. <Function Name="sp_renamediagram" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo">
  257. <Parameter Name="diagramname" Type="nvarchar" Mode="In" />
  258. <Parameter Name="owner_id" Type="int" Mode="In" />
  259. <Parameter Name="new_diagramname" Type="nvarchar" Mode="In" />
  260. </Function>
  261. <Function Name="sp_upgraddiagrams" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />
  262. <EntityContainer Name="Хранилище KarpovTuriModelContainer">
  263. <EntitySet Name="Country" EntityType="Self.Country" Schema="dbo" store:Type="Tables" />
  264. <EntitySet Name="Hotel" EntityType="Self.Hotel" Schema="dbo" store:Type="Tables" />
  265. <EntitySet Name="HotelComment" EntityType="Self.HotelComment" Schema="dbo" store:Type="Tables" />
  266. <EntitySet Name="HotelImage" EntityType="Self.HotelImage" Schema="dbo" store:Type="Tables" />
  267. <EntitySet Name="HotelOfTour" EntityType="Self.HotelOfTour" Schema="dbo" store:Type="Tables" />
  268. <EntitySet Name="sysdiagrams" EntityType="Self.sysdiagrams" Schema="dbo" store:Type="Tables" />
  269. <EntitySet Name="Tour" EntityType="Self.Tour" Schema="dbo" store:Type="Tables" />
  270. <EntitySet Name="Type" EntityType="Self.Type" Schema="dbo" store:Type="Tables" />
  271. <EntitySet Name="TypeOfTour" EntityType="Self.TypeOfTour" Schema="dbo" store:Type="Tables" />
  272. <EntitySet Name="Count_hotel" EntityType="Self.Count_hotel" store:Type="Views" store:Schema="dbo">
  273. <DefiningQuery>SELECT
  274. [Count_hotel].[Название отеля] AS [Название отеля],
  275. [Count_hotel].[Количество звёзд] AS [Количество звёзд],
  276. [Count_hotel].[Страна] AS [Страна]
  277. FROM [dbo].[Count_hotel] AS [Count_hotel]</DefiningQuery>
  278. </EntitySet>
  279. <EntitySet Name="Description" EntityType="Self.Description" store:Type="Views" store:Schema="dbo">
  280. <DefiningQuery>SELECT
  281. [Description].[Название тура] AS [Название тура],
  282. [Description].[Превью] AS [Превью],
  283. [Description].[Цена] AS [Цена],
  284. [Description].[Тип] AS [Тип],
  285. [Description].[Описание] AS [Описание]
  286. FROM [dbo].[Description] AS [Description]</DefiningQuery>
  287. </EntitySet>
  288. <EntitySet Name="Hotel_Desc" EntityType="Self.Hotel_Desc" store:Type="Views" store:Schema="dbo">
  289. <DefiningQuery>SELECT
  290. [Hotel_Desc].[Название отеля] AS [Название отеля],
  291. [Hotel_Desc].[Картинка] AS [Картинка],
  292. [Hotel_Desc].[Автор] AS [Автор],
  293. [Hotel_Desc].[Описание] AS [Описание]
  294. FROM [dbo].[Hotel_Desc] AS [Hotel_Desc]</DefiningQuery>
  295. </EntitySet>
  296. <EntitySet Name="TourView" EntityType="Self.TourView" store:Type="Views" store:Schema="dbo">
  297. <DefiningQuery>SELECT
  298. [TourView].[Название страны] AS [Название страны],
  299. [TourView].[Название отеля] AS [Название отеля],
  300. [TourView].[Количество звёзд] AS [Количество звёзд],
  301. [TourView].[Номер билета] AS [Номер билета],
  302. [TourView].[Название тура] AS [Название тура],
  303. [TourView].[Превью] AS [Превью],
  304. [TourView].[Цена] AS [Цена],
  305. [TourView].[Актуальность] AS [Актуальность],
  306. [TourView].[Тип тура] AS [Тип тура],
  307. [TourView].[Описание] AS [Описание]
  308. FROM [dbo].[TourView] AS [TourView]</DefiningQuery>
  309. </EntitySet>
  310. <AssociationSet Name="FK_Hotel_Country" Association="Self.FK_Hotel_Country">
  311. <End Role="Country" EntitySet="Country" />
  312. <End Role="Hotel" EntitySet="Hotel" />
  313. </AssociationSet>
  314. <AssociationSet Name="FK_HotelComment_Hotel" Association="Self.FK_HotelComment_Hotel">
  315. <End Role="Hotel" EntitySet="Hotel" />
  316. <End Role="HotelComment" EntitySet="HotelComment" />
  317. </AssociationSet>
  318. <AssociationSet Name="FK_HotelImage_Hotel" Association="Self.FK_HotelImage_Hotel">
  319. <End Role="Hotel" EntitySet="Hotel" />
  320. <End Role="HotelImage" EntitySet="HotelImage" />
  321. </AssociationSet>
  322. <AssociationSet Name="FK_HotelOfTour_Hotel" Association="Self.FK_HotelOfTour_Hotel">
  323. <End Role="Hotel" EntitySet="Hotel" />
  324. <End Role="HotelOfTour" EntitySet="HotelOfTour" />
  325. </AssociationSet>
  326. <AssociationSet Name="FK_HotelOfTour_Tour" Association="Self.FK_HotelOfTour_Tour">
  327. <End Role="Tour" EntitySet="Tour" />
  328. <End Role="HotelOfTour" EntitySet="HotelOfTour" />
  329. </AssociationSet>
  330. <AssociationSet Name="FK_TypeOfTour_Tour" Association="Self.FK_TypeOfTour_Tour">
  331. <End Role="Tour" EntitySet="Tour" />
  332. <End Role="TypeOfTour" EntitySet="TypeOfTour" />
  333. </AssociationSet>
  334. <AssociationSet Name="FK_TypeOfTour_Type" Association="Self.FK_TypeOfTour_Type">
  335. <End Role="Type" EntitySet="Type" />
  336. <End Role="TypeOfTour" EntitySet="TypeOfTour" />
  337. </AssociationSet>
  338. </EntityContainer>
  339. </Schema>