MCD → MLD (Merise)

Tutoriel rapide

  1. Saisissez votre MCD dans la zone ci-dessous (voir l’exemple).
  2. La transformation vers le MLD, le SQL et le Rapport se fait automatiquement.
  3. Naviguez via les onglets: « MLD (JSON) », « SQL », « Rapport », « Diagramme ».
  4. Exportez les fichiers: mcd.json, mld.json, schema.sql, report.md. Les diagrammes peuvent être exportés en SVG/PNG.
  5. Erreurs: elles s’affichent sous la zone de saisie (avec l’emplacement s’il est connu).
Voir un exemple de MCD (DSL)
ENTITY Auteur {
  id PK
  nom
}

ENTITY Livre {
  id PK
  titre
}

RELATION Ecrit Auteur(1,N) Livre(1,1)
{
  "tables": [
    {
      "name": "apprenants",
      "columns": [
        {
          "name": "id",
          "type": "bigserial",
          "primaryKey": true,
          "notNull": true,
          "origin": {
            "kind": "attribute",
            "name": "Apprenant.id",
            "detail": "généré"
          }
        },
        {
          "name": "id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Apprenant.id"
          }
        },
        {
          "name": "nom",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Apprenant.nom"
          }
        },
        {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Apprenant.email"
          }
        },
        {
          "name": "date_naissance",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Apprenant.date_naissance"
          }
        }
      ],
      "primaryKey": "id",
      "foreignKeys": [],
      "indexes": [],
      "origin": {
        "kind": "entity",
        "name": "Apprenant"
      }
    },
    {
      "name": "promotions",
      "columns": [
        {
          "name": "id",
          "type": "bigserial",
          "primaryKey": true,
          "notNull": true,
          "origin": {
            "kind": "attribute",
            "name": "Promotion.id",
            "detail": "généré"
          }
        },
        {
          "name": "id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Promotion.id"
          }
        },
        {
          "name": "nom",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Promotion.nom"
          }
        },
        {
          "name": "annee",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "attribute",
            "name": "Promotion.annee"
          }
        }
      ],
      "primaryKey": "id",
      "foreignKeys": [],
      "indexes": [],
      "origin": {
        "kind": "entity",
        "name": "Promotion"
      }
    },
    {
      "name": "apprenants_promotions",
      "columns": [
        {
          "name": "apprenant_id",
          "type": "bigint",
          "notNull": true,
          "origin": {
            "kind": "relation",
            "name": "Inscription"
          }
        },
        {
          "name": "promotion_id",
          "type": "bigint",
          "notNull": true,
          "origin": {
            "kind": "relation",
            "name": "Inscription"
          }
        },
        {
          "name": "date_inscription",
          "type": "text",
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "relation-attribute",
            "name": "Inscription.date_inscription"
          }
        },
        {
          "name": "statut",
          "type": "text",
          "notNull": false,
          "unique": false,
          "origin": {
            "kind": "relation-attribute",
            "name": "Inscription.statut"
          }
        }
      ],
      "primaryKey": [
        "apprenant_id",
        "promotion_id"
      ],
      "foreignKeys": [
        {
          "column": "apprenant_id",
          "referencesTable": "apprenants",
          "referencesColumn": "id",
          "unique": false,
          "origin": {
            "kind": "relation",
            "name": "Inscription"
          }
        },
        {
          "column": "promotion_id",
          "referencesTable": "promotions",
          "referencesColumn": "id",
          "unique": false,
          "origin": {
            "kind": "relation",
            "name": "Inscription"
          }
        }
      ],
      "origin": {
        "kind": "relation",
        "name": "Inscription"
      }
    }
  ]
}