Files
Daniel Cortes 7fbf91f8b1 Initial commit
2020-05-22 01:32:58 -04:00

136 lines
6.7 KiB
XML
Executable File

<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="EntitiesModel" 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="Comentario">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Int32" Nullable="false" />
<Property Name="post_id" Type="Int32" Nullable="false" />
<Property Name="user_id" Type="Int32" Nullable="false" />
<NavigationProperty Name="post" Relationship="Self.FK_comentario_post" FromRole="comentario" ToRole="post" />
<NavigationProperty Name="user" Relationship="Self.FK_comentario_user" FromRole="comentario" ToRole="user" />
<Property Name="html" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="Post">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Int32" Nullable="false" />
<Property Name="title" Type="String" MaxLength="255" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="markdown" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" Nullable="false" />
<NavigationProperty Name="comentarios" Relationship="Self.FK_comentario_post" FromRole="post" ToRole="comentario" />
<NavigationProperty Name="votos" Relationship="Self.FK_voto_post" FromRole="post" ToRole="voto" />
<Property Name="user_id" Type="Int32" Nullable="false" />
<NavigationProperty Name="user" Relationship="EntitiesModel.FK_post_user" FromRole="Post" ToRole="User" />
<Property Name="html" Type="String" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="User">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="username" Type="String" MaxLength="255" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="password" Type="Binary" MaxLength="32" FixedLength="true" Nullable="false" />
<Property Name="salt" Type="Binary" MaxLength="20" FixedLength="true" Nullable="false" />
<NavigationProperty Name="comentarios" Relationship="Self.FK_comentario_user" FromRole="user" ToRole="comentario" />
<NavigationProperty Name="votos" Relationship="Self.FK_voto_user" FromRole="user" ToRole="voto" />
<NavigationProperty Name="posts" Relationship="EntitiesModel.FK_post_user" FromRole="User" ToRole="Post" />
</EntityType>
<EntityType Name="Voto">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Int32" Nullable="false" />
<Property Name="post_id" Type="Int32" Nullable="false" />
<Property Name="user_id" Type="Int32" Nullable="false" />
<Property Name="positivo" Type="Boolean" Nullable="false" />
<NavigationProperty Name="post" Relationship="Self.FK_voto_post" FromRole="voto" ToRole="post" />
<NavigationProperty Name="user" Relationship="Self.FK_voto_user" FromRole="voto" ToRole="user" />
</EntityType>
<Association Name="FK_comentario_post">
<End Role="post" Type="EntitiesModel.Post" Multiplicity="1" />
<End Role="comentario" Type="EntitiesModel.Comentario" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="post">
<PropertyRef Name="id" />
</Principal>
<Dependent Role="comentario">
<PropertyRef Name="post_id" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_comentario_user">
<End Role="user" Type="EntitiesModel.User" Multiplicity="1" />
<End Role="comentario" Type="EntitiesModel.Comentario" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="user">
<PropertyRef Name="id" />
</Principal>
<Dependent Role="comentario">
<PropertyRef Name="user_id" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_voto_post">
<End Role="post" Type="EntitiesModel.Post" Multiplicity="1" />
<End Role="voto" Type="EntitiesModel.Voto" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="post">
<PropertyRef Name="id" />
</Principal>
<Dependent Role="voto">
<PropertyRef Name="post_id" />
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FK_voto_user">
<End Role="user" Type="EntitiesModel.User" Multiplicity="1" />
<End Role="voto" Type="EntitiesModel.Voto" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="user">
<PropertyRef Name="id" />
</Principal>
<Dependent Role="voto">
<PropertyRef Name="user_id" />
</Dependent>
</ReferentialConstraint>
</Association>
<EntityContainer Name="Entities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="Comentarios" EntityType="EntitiesModel.Comentario" />
<EntitySet Name="Posts" EntityType="EntitiesModel.Post" />
<EntitySet Name="Users" EntityType="EntitiesModel.User" />
<EntitySet Name="Votos" EntityType="EntitiesModel.Voto" />
<AssociationSet Name="FK_comentario_post" Association="Self.FK_comentario_post">
<End Role="post" EntitySet="Posts" />
<End Role="comentario" EntitySet="Comentarios" />
</AssociationSet>
<AssociationSet Name="FK_comentario_user" Association="Self.FK_comentario_user">
<End Role="user" EntitySet="Users" />
<End Role="comentario" EntitySet="Comentarios" />
</AssociationSet>
<AssociationSet Name="FK_voto_post" Association="Self.FK_voto_post">
<End Role="post" EntitySet="Posts" />
<End Role="voto" EntitySet="Votos" />
</AssociationSet>
<AssociationSet Name="FK_voto_user" Association="Self.FK_voto_user">
<End Role="user" EntitySet="Users" />
<End Role="voto" EntitySet="Votos" />
</AssociationSet>
<AssociationSet Name="FK_post_user" Association="EntitiesModel.FK_post_user">
<End Role="User" EntitySet="Users" />
<End Role="Post" EntitySet="Posts" />
</AssociationSet>
</EntityContainer>
<Association Name="FK_post_user">
<End Type="EntitiesModel.User" Role="User" Multiplicity="1" />
<End Type="EntitiesModel.Post" Role="Post" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="User">
<PropertyRef Name="id" />
</Principal>
<Dependent Role="Post">
<PropertyRef Name="user_id" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>