<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="gr672_pgvModel.Store" 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">
  <EntityType Name="Role">
    <Key>
      <PropertyRef Name="RoleID" />
    </Key>
    <Property Name="RoleID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="RoleName" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="User">
    <Key>
      <PropertyRef Name="UserID" />
    </Key>
    <Property Name="UserID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="LastName" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="MiddleName" Type="nvarchar" MaxLength="50" />
    <Property Name="Phone" Type="nvarchar" MaxLength="12" Nullable="false" />
    <Property Name="Email" Type="nvarchar" MaxLength="200" Nullable="false" />
    <Property Name="IDRole" Type="int" Nullable="false" />
    <Property Name="Login" Type="nvarchar" MaxLength="50" Nullable="false" />
    <Property Name="Password" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <EntityType Name="Violation">
    <Key>
      <PropertyRef Name="ViolationID" />
    </Key>
    <Property Name="ViolationID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="IDViolationType" Type="int" Nullable="false" />
    <Property Name="Photo" Type="image" Nullable="false" />
    <Property Name="Address" Type="nvarchar(max)" Nullable="false" />
    <Property Name="Description" Type="nvarchar(max)" Nullable="false" />
    <Property Name="IsReviewed" Type="bit" />
    <Property Name="Comment" Type="nvarchar(max)" />
    <Property Name="IDUser" Type="int" Nullable="false" />
    <Property Name="CarNumber" Type="nvarchar" MaxLength="50" />
  </EntityType>
  <EntityType Name="ViolationType">
    <Key>
      <PropertyRef Name="ViolationTypeID" />
    </Key>
    <Property Name="ViolationTypeID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
    <Property Name="TypeName" Type="nvarchar" MaxLength="50" Nullable="false" />
  </EntityType>
  <Association Name="FK_User_Role">
    <End Role="Role" Type="Self.Role" Multiplicity="1" />
    <End Role="User" Type="Self.User" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="Role">
        <PropertyRef Name="RoleID" />
      </Principal>
      <Dependent Role="User">
        <PropertyRef Name="IDRole" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Violation_User">
    <End Role="User" Type="Self.User" Multiplicity="1" />
    <End Role="Violation" Type="Self.Violation" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="User">
        <PropertyRef Name="UserID" />
      </Principal>
      <Dependent Role="Violation">
        <PropertyRef Name="IDUser" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="FK_Violation_ViolationType">
    <End Role="ViolationType" Type="Self.ViolationType" Multiplicity="1" />
    <End Role="Violation" Type="Self.Violation" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="ViolationType">
        <PropertyRef Name="ViolationTypeID" />
      </Principal>
      <Dependent Role="Violation">
        <PropertyRef Name="IDViolationType" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <EntityContainer Name="gr672_pgvModelStoreContainer">
    <EntitySet Name="Role" EntityType="Self.Role" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="User" EntityType="Self.User" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="Violation" EntityType="Self.Violation" Schema="dbo" store:Type="Tables" />
    <EntitySet Name="ViolationType" EntityType="Self.ViolationType" Schema="dbo" store:Type="Tables" />
    <AssociationSet Name="FK_User_Role" Association="Self.FK_User_Role">
      <End Role="Role" EntitySet="Role" />
      <End Role="User" EntitySet="User" />
    </AssociationSet>
    <AssociationSet Name="FK_Violation_User" Association="Self.FK_Violation_User">
      <End Role="User" EntitySet="User" />
      <End Role="Violation" EntitySet="Violation" />
    </AssociationSet>
    <AssociationSet Name="FK_Violation_ViolationType" Association="Self.FK_Violation_ViolationType">
      <End Role="ViolationType" EntitySet="ViolationType" />
      <End Role="Violation" EntitySet="Violation" />
    </AssociationSet>
  </EntityContainer>
</Schema>