...

Text file src/oss.terrastruct.com/d2/e2etests/testdata/files/ent2d2_right.d2

Documentation: oss.terrastruct.com/d2/e2etests/testdata/files

     1direction: right
     2# Edges
     3User <-> User: "spouse\nspouse" {
     4  # o2o optional
     5  source-arrowhead: {
     6    shape: cf-one-required
     7  }
     8  target-arrowhead: {
     9    shape: cf-one
    10  }
    11}
    12User <-> User: "children\nparent\nyo\nwhoa\nhey" {
    13  # o2m optional
    14  source-arrowhead: {
    15    shape: cf-one-required
    16  }
    17  target-arrowhead: {
    18    shape: cf-many
    19  }
    20}
    21User <-> Pet: "pets/owner" {
    22  # o2m optional
    23  source-arrowhead: {
    24    shape: cf-one-required
    25  }
    26  target-arrowhead: {
    27    shape: cf-many
    28  }
    29}
    30User <-> Card: "card/owner" {
    31  # o2o optional
    32  source-arrowhead: {
    33    shape: cf-one-required
    34  }
    35  target-arrowhead: {
    36    shape: cf-one
    37  }
    38}
    39User <-> Post: "posts/author" {
    40  # o2m optional
    41  source-arrowhead: {
    42    shape: cf-one-required
    43  }
    44  target-arrowhead: {
    45    shape: cf-many
    46  }
    47}
    48User <-> Metadata: "metadata/user" {
    49  # o2m optional
    50  source-arrowhead: {
    51    shape: cf-one-required
    52  }
    53  target-arrowhead: {
    54    shape: cf-many
    55  }
    56}
    57User <-> Info: "info/user" {
    58  # o2m optional
    59  source-arrowhead: {
    60    shape: cf-one-required
    61  }
    62  target-arrowhead: {
    63    shape: cf-many
    64  }
    65}
    66
    67# Tables
    68Card: {
    69  shape: sql_table
    70  id: int {constraint: primary_key}
    71  owner_id: int {constraint: foreign_key}
    72}
    73Info: {
    74  shape: sql_table
    75  id: int {constraint: primary_key}
    76  content: json.RawMessage
    77}
    78Metadata: {
    79  shape: sql_table
    80  id: int {constraint: primary_key}
    81  age: int
    82}
    83Pet: {
    84  shape: sql_table
    85  id: int {constraint: primary_key}
    86  owner_id: int {constraint: foreign_key}
    87}
    88Post: {
    89  shape: sql_table
    90  id: int {constraint: primary_key}
    91  text: string
    92  author_id: int {constraint: foreign_key}
    93}
    94User: {
    95  shape: sql_table
    96  id: int {constraint: primary_key}
    97  parent_id: int {constraint: foreign_key}
    98  spouse_id: int {constraint: foreign_key}
    99}

View as plain text