<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="ExamPm01Model" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
  <EntityType Name="metrics">
    <Key>
      <PropertyRef Name="id" />
    </Key>
    <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="metric" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
    <NavigationProperty Name="postsmetrics" Relationship="Self.postsmetrics_id_metric_fkey" FromRole="metrics" ToRole="postsmetrics" />
    <NavigationProperty Name="usersmetrics" Relationship="Self.usersmetrics_id_metric_fkey" FromRole="metrics" ToRole="usersmetrics" />
  </EntityType>
  <EntityType Name="posts">
    <Key>
      <PropertyRef Name="id" />
    </Key>
    <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="title" Type="String" MaxLength="30" FixedLength="false" Unicode="false" />
    <Property Name="id_role" Type="Int32" />
    <NavigationProperty Name="roles" Relationship="Self.posts_roles_fk" FromRole="posts" ToRole="roles" />
    <NavigationProperty Name="postsmetrics" Relationship="Self.postsmetrics_id_post_fkey" FromRole="posts" ToRole="postsmetrics" />
    <NavigationProperty Name="users" Relationship="Self.users_id_post_fkey" FromRole="posts" ToRole="users" />
  </EntityType>
  <EntityType Name="postsmetrics">
    <Key>
      <PropertyRef Name="id" />
    </Key>
    <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="id_metric" Type="Int32" />
    <Property Name="id_post" Type="Int32" />
    <NavigationProperty Name="metrics" Relationship="Self.postsmetrics_id_metric_fkey" FromRole="postsmetrics" ToRole="metrics" />
    <NavigationProperty Name="posts" Relationship="Self.postsmetrics_id_post_fkey" FromRole="postsmetrics" ToRole="posts" />
  </EntityType>
  <EntityType Name="roles">
    <Key>
      <PropertyRef Name="id" />
    </Key>
    <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="role" Type="String" MaxLength="15" FixedLength="false" Unicode="false" />
    <NavigationProperty Name="posts" Relationship="Self.posts_roles_fk" FromRole="roles" ToRole="posts" />
  </EntityType>
  <EntityType Name="sysdiagrams">
    <Key>
      <PropertyRef Name="diagram_id" />
    </Key>
    <Property Name="name" Type="String" MaxLength="128" FixedLength="false" Unicode="true" Nullable="false" />
    <Property Name="principal_id" Type="Int32" Nullable="false" />
    <Property Name="diagram_id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="version" Type="Int32" />
    <Property Name="definition" Type="Binary" MaxLength="Max" FixedLength="false" />
  </EntityType>
  <EntityType Name="users">
    <Key>
      <PropertyRef Name="id" />
    </Key>
    <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="surname" Type="String" MaxLength="30" FixedLength="false" Unicode="false" />
    <Property Name="firstname" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
    <Property Name="patronymic" Type="String" MaxLength="35" FixedLength="false" Unicode="false" />
    <Property Name="id_post" Type="Int32" />
    <Property Name="email" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
    <Property Name="password" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
    <NavigationProperty Name="posts" Relationship="Self.users_id_post_fkey" FromRole="users" ToRole="posts" />
    <NavigationProperty Name="usersmetrics" Relationship="Self.usersmetrics_id_user_fkey" FromRole="users" ToRole="usersmetrics" />
  </EntityType>
  <EntityType Name="usersmetrics">
    <Key>
      <PropertyRef Name="id" />
    </Key>
    <Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
    <Property Name="id_user" Type="Int32" />
    <Property Name="id_metric" Type="Int32" />
    <Property Name="coefficient" Type="Double" />
    <Property Name="dateofachievement" Type="DateTime" Precision="0" />
    <NavigationProperty Name="metrics" Relationship="Self.usersmetrics_id_metric_fkey" FromRole="usersmetrics" ToRole="metrics" />
    <NavigationProperty Name="users" Relationship="Self.usersmetrics_id_user_fkey" FromRole="usersmetrics" ToRole="users" />
  </EntityType>
  <Association Name="postsmetrics_id_metric_fkey">
    <End Role="metrics" Type="Self.metrics" Multiplicity="0..1" />
    <End Role="postsmetrics" Type="Self.postsmetrics" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="metrics">
        <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="postsmetrics">
        <PropertyRef Name="id_metric" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="usersmetrics_id_metric_fkey">
    <End Role="metrics" Type="Self.metrics" Multiplicity="0..1" />
    <End Role="usersmetrics" Type="Self.usersmetrics" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="metrics">
        <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="usersmetrics">
        <PropertyRef Name="id_metric" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="posts_roles_fk">
    <End Role="roles" Type="Self.roles" Multiplicity="0..1" />
    <End Role="posts" Type="Self.posts" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="roles">
        <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="posts">
        <PropertyRef Name="id_role" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="postsmetrics_id_post_fkey">
    <End Role="posts" Type="Self.posts" Multiplicity="0..1" />
    <End Role="postsmetrics" Type="Self.postsmetrics" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="posts">
        <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="postsmetrics">
        <PropertyRef Name="id_post" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="users_id_post_fkey">
    <End Role="posts" Type="Self.posts" Multiplicity="0..1" />
    <End Role="users" Type="Self.users" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="posts">
        <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="users">
        <PropertyRef Name="id_post" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <Association Name="usersmetrics_id_user_fkey">
    <End Role="users" Type="Self.users" Multiplicity="0..1" />
    <End Role="usersmetrics" Type="Self.usersmetrics" Multiplicity="*" />
    <ReferentialConstraint>
      <Principal Role="users">
        <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="usersmetrics">
        <PropertyRef Name="id_user" />
      </Dependent>
    </ReferentialConstraint>
  </Association>
  <EntityContainer Name="ExamPm01Entities" annotation:LazyLoadingEnabled="true">
    <EntitySet Name="metrics" EntityType="Self.metrics" />
    <EntitySet Name="posts" EntityType="Self.posts" />
    <EntitySet Name="postsmetrics" EntityType="Self.postsmetrics" />
    <EntitySet Name="roles" EntityType="Self.roles" />
    <EntitySet Name="sysdiagrams" EntityType="Self.sysdiagrams" />
    <EntitySet Name="users" EntityType="Self.users" />
    <EntitySet Name="usersmetrics" EntityType="Self.usersmetrics" />
    <AssociationSet Name="postsmetrics_id_metric_fkey" Association="Self.postsmetrics_id_metric_fkey">
      <End Role="metrics" EntitySet="metrics" />
      <End Role="postsmetrics" EntitySet="postsmetrics" />
    </AssociationSet>
    <AssociationSet Name="usersmetrics_id_metric_fkey" Association="Self.usersmetrics_id_metric_fkey">
      <End Role="metrics" EntitySet="metrics" />
      <End Role="usersmetrics" EntitySet="usersmetrics" />
    </AssociationSet>
    <AssociationSet Name="posts_roles_fk" Association="Self.posts_roles_fk">
      <End Role="roles" EntitySet="roles" />
      <End Role="posts" EntitySet="posts" />
    </AssociationSet>
    <AssociationSet Name="postsmetrics_id_post_fkey" Association="Self.postsmetrics_id_post_fkey">
      <End Role="posts" EntitySet="posts" />
      <End Role="postsmetrics" EntitySet="postsmetrics" />
    </AssociationSet>
    <AssociationSet Name="users_id_post_fkey" Association="Self.users_id_post_fkey">
      <End Role="posts" EntitySet="posts" />
      <End Role="users" EntitySet="users" />
    </AssociationSet>
    <AssociationSet Name="usersmetrics_id_user_fkey" Association="Self.usersmetrics_id_user_fkey">
      <End Role="users" EntitySet="users" />
      <End Role="usersmetrics" EntitySet="usersmetrics" />
    </AssociationSet>
  </EntityContainer>
</Schema>