Загрузка данных


<mxfile host="app.diagrams.net" modified="2024-01-01T00:00:00.000Z" agent="Mozilla/5.0" version="21.0.0" etag="xxx" type="device">
  <diagram name="ER-диаграмма" id="er-diagram">
    <mxGraphModel dx="1422" dy="794" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>
        
        <!-- WRITER -->
        <mxCell id="writer" value="WRITER" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="50" y="40" width="280" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="writer_passport" value="passport_no (PK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="writer">
          <mxGeometry y="30" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="writer_last" value="last_name" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="writer">
          <mxGeometry y="60" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="writer_first" value="first_name" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="writer">
          <mxGeometry y="90" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="writer_middle" value="middle_name" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="writer">
          <mxGeometry y="120" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="writer_address" value="address" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="writer">
          <mxGeometry y="150" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="writer_phone" value="phone" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="writer">
          <mxGeometry y="180" width="280" height="30" as="geometry"/>
        </mxCell>

        <!-- CONTRACT -->
        <mxCell id="contract" value="CONTRACT" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="480" y="40" width="300" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="contract_id" value="contract_id (PK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="contract">
          <mxGeometry y="30" width="300" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="contract_writer" value="writer_passport (FK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="contract">
          <mxGeometry y="60" width="300" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="contract_date" value="sign_date" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="contract">
          <mxGeometry y="90" width="300" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="contract_term" value="term_years" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="contract">
          <mxGeometry y="120" width="300" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="contract_rest" value="restaurant_flag" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="contract">
          <mxGeometry y="150" width="300" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="contract_rest_date" value="restaurant_date" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="contract">
          <mxGeometry y="180" width="300" height="30" as="geometry"/>
        </mxCell>

        <!-- BOOK -->
        <mxCell id="book" value="BOOK" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="50" y="400" width="280" height="250" as="geometry"/>
        </mxCell>
        <mxCell id="book_code" value="book_code (PK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="30" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="book_title" value="title" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="60" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="book_publisher" value="publisher" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="90" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="book_release" value="release_date" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="120" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="book_cost" value="cost_price" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="150" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="book_sale" value="sale_price" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="180" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="book_royalty" value="royalty_total" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book">
          <mxGeometry y="210" width="280" height="30" as="geometry"/>
        </mxCell>

        <!-- BOOK_WRITER -->
        <mxCell id="book_writer" value="BOOK_WRITER" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="420" y="400" width="240" height="90" as="geometry"/>
        </mxCell>
        <mxCell id="bw_book" value="book_code (PK, FK)" style="text;strokeColor=#d6b656;fillColor=#ffe6cc;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book_writer">
          <mxGeometry y="30" width="240" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="bw_writer" value="writer_passport (PK, FK)" style="text;strokeColor=#d6b656;fillColor=#ffe6cc;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="book_writer">
          <mxGeometry y="60" width="240" height="30" as="geometry"/>
        </mxCell>

        <!-- CUSTOMER -->
        <mxCell id="customer" value="CUSTOMER" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="800" y="400" width="280" height="190" as="geometry"/>
        </mxCell>
        <mxCell id="customer_id" value="customer_id (PK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="customer">
          <mxGeometry y="30" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="customer_name" value="name" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="customer">
          <mxGeometry y="60" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="customer_address" value="address" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="customer">
          <mxGeometry y="90" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="customer_phone" value="phone" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="customer">
          <mxGeometry y="120" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="customer_contact" value="contact_person" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="customer">
          <mxGeometry y="150" width="280" height="30" as="geometry"/>
        </mxCell>

        <!-- ORDERS -->
        <mxCell id="orders" value="ORDERS" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="800" y="40" width="280" height="220" as="geometry"/>
        </mxCell>
        <mxCell id="orders_id" value="order_id (PK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="orders">
          <mxGeometry y="30" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="orders_book" value="book_code (FK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="orders">
          <mxGeometry y="60" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="orders_customer" value="customer_id (FK)" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="orders">
          <mxGeometry y="90" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="orders_date" value="order_date" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="orders">
          <mxGeometry y="120" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="orders_execute" value="execute_date" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="orders">
          <mxGeometry y="150" width="280" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="orders_qty" value="quantity" style="text;strokeColor=#6c8ebf;fillColor=#e1d5e7;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="orders">
          <mxGeometry y="180" width="280" height="30" as="geometry"/>
        </mxCell>

        <!-- СВЯЗИ -->
        <!-- WRITER -> CONTRACT (1:1) -->
        <mxCell id="rel1" value="1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#6c8ebf;fontStyle=1;fontSize=14;" edge="1" parent="1" source="writer" target="contract">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rel1_label" value="1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontStyle=1;fontSize=16;" vertex="1" connectable="0" parent="rel1">
          <mxGeometry x="-0.1" y="-1" relative="1" as="geometry">
            <mxPoint as="offset"/>
          </mxGeometry>
        </mxCell>

        <!-- WRITER -> BOOK_WRITER (1:M) -->
        <mxCell id="rel2" value="1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#6c8ebf;fontStyle=1;fontSize=14;" edge="1" parent="1" source="writer" target="book_writer">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rel2_label" value="1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontStyle=1;fontSize=16;" vertex="1" connectable="0" parent="rel2">
          <mxGeometry x="-0.1" y="1" relative="1" as="geometry">
            <mxPoint as="offset"/>
          </mxGeometry>
        </mxCell>

        <!-- BOOK -> BOOK_WRITER (1:M) -->
        <mxCell id="rel3" value="1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#6c8ebf;fontStyle=1;fontSize=14;" edge="1" parent="1" source="book" target="book_writer">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rel3_label" value="1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontStyle=1;fontSize=16;" vertex="1" connectable="0" parent="rel3">
          <mxGeometry x="-0.1" y="-1" relative="1" as="geometry">
            <mxPoint as="offset"/>
          </mxGeometry>
        </mxCell>

        <!-- BOOK -> ORDERS (1:M) -->
        <mxCell id="rel4" value="1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.3;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#6c8ebf;fontStyle=1;fontSize=14;" edge="1" parent="1" source="book" target="orders">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rel4_label" value="1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontStyle=1;fontSize=16;" vertex="1" connectable="0" parent="rel4">
          <mxGeometry x="-0.1" y="-1" relative="1" as="geometry">
            <mxPoint as="offset"/>
          </mxGeometry>
        </mxCell>

        <!-- CUSTOMER -> ORDERS (1:M) -->
        <mxCell id="rel5" value="1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.3;exitDx=0;exitDy=0;entryX=0;entryY=1;entryDx=0;entryDy=0;strokeWidth=2;strokeColor=#6c8ebf;fontStyle=1;fontSize=14;" edge="1" parent="1" source="orders" target="customer">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="rel5_label" value="1" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontStyle=1;fontSize=16;" vertex="1" connectable="0" parent="rel5">
          <mxGeometry x="-0.1" y="-1" relative="1" as="geometry">
            <mxPoint as="offset"/>
          </mxGeometry>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
</mxfile>