database
DataBaseElement
name
RailsData
binary
binary
boolean
boolean
date
date
dateTime
dateTime
decimal
decimal
float
float
integer
integer
string
string
text
text
time
time
timestamp
timestamp
Schema
tables
Table
columns
primaryKey
foreignKeys
Column
type
ForeignKey
column
reference
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="database" nsURI="http://database/1.0" nsPrefix="database">
  <eAnnotations source="gmf">
    <details key="foo" value="foo"/>
  </eAnnotations>
  <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
    <details key="invocationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="settingDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
    <details key="validationDelegates" value="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot"/>
  </eAnnotations>
  <eClassifiers xsi:type="ecore:EClass" name="DataBaseElement" abstract="true">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="nameEmpty illegalName"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="nameEmpty" value="not (self.name&#xA;&#x9;&#x9;&#x9;->isEmpty())"/>
      <details key="illegalName" value="Sequence{1 .. self.name.size()}&#xA;&#x9;&#x9;&#x9;->collect(i | self.name.substring(i, i))&#xA;&#x9;&#x9;&#x9;->excludes(' ')"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EEnum" name="RailsData">
    <eLiterals name="binary"/>
    <eLiterals name="boolean" value="1"/>
    <eLiterals name="date" value="2"/>
    <eLiterals name="dateTime" value="3"/>
    <eLiterals name="decimal" value="4"/>
    <eLiterals name="float" value="5"/>
    <eLiterals name="integer" value="6"/>
    <eLiterals name="string" value="7"/>
    <eLiterals name="text" value="8"/>
    <eLiterals name="time" value="9"/>
    <eLiterals name="timestamp" value="10"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Schema" eSuperTypes="#//DataBaseElement">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="tableNameUnique"/>
    </eAnnotations>
    <eAnnotations source="gmf.diagram">
      <details key="foo" value="foo"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="tableNameUnique" value="self.tables&#xA;&#x9;&#x9;&#x9;->isUnique(name.toUpperCase())"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="tables" upperBound="-1"
        eType="#//Table" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Table" eSuperTypes="#//DataBaseElement">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="noIdName columnNameUnique cycleForeignKey"/>
    </eAnnotations>
    <eAnnotations source="gmf.node">
      <details key="tool.description" value="Table"/>
      <details key="tool.name" value="Table"/>
      <details key="border.color" value="0,0,0"/>
      <details key="label" value="name"/>
      <details key="label.placement" value="internal"/>
      <details key="label.icon" value="false"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="noIdName" value="not (self.columns&#xA;&#x9;&#x9;&#x9;->exists(name.toUpperCase() = 'id'.toUpperCase()))"/>
      <details key="columnNameUnique" value="self.columns&#xA;&#x9;&#x9;&#x9;->isUnique(name.toUpperCase())"/>
      <details key="cycleForeignKey" value="not(self.foreignKeys&#xA;&#x9;&#x9;&#x9;->notEmpty() and self.foreignKeys&#xA;&#x9;&#x9;&#x9;->exists(reference.name = self.name))"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="columns" lowerBound="1"
        upperBound="-1" eType="#//Column" containment="true">
      <eAnnotations source="gmf.compartment">
        <details key="layout" value="list"/>
      </eAnnotations>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKey" lowerBound="1"
        eType="#//Column"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="foreignKeys" upperBound="-1"
        eType="#//ForeignKey" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="Column" eSuperTypes="#//DataBaseElement">
    <eAnnotations source="gmf.node">
      <details key="tool.description" value="Column"/>
      <details key="tool.name" value="Column"/>
      <details key="label" value="name,type"/>
      <details key="figure" value="rectangle"/>
      <details key="label.icon" value="true"/>
      <details key="label.pattern" value="{0}:{1}"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//RailsData"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="ForeignKey">
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
      <details key="constraints" value="sameTypeAtLink"/>
    </eAnnotations>
    <eAnnotations source="gmf.link">
      <details key="tool.description" value="Foreign Key"/>
      <details key="tool.name" value="Foreign Key"/>
      <details key="source" value="column"/>
      <details key="target" value="reference"/>
      <details key="target.decoration" value="arrow"/>
    </eAnnotations>
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
      <details key="sameTypeAtLink" value="self.column.type = self.reference.primaryKey.type"/>
    </eAnnotations>
    <eStructuralFeatures xsi:type="ecore:EReference" name="column" lowerBound="1"
        eType="#//Column"/>
    <eStructuralFeatures xsi:type="ecore:EReference" name="reference" lowerBound="1"
        eType="#//Table"/>
  </eClassifiers>
</ecore:EPackage>

{"directed":true,"nodes":[{"nsPrefix":"database","nsURI":"http://database/1.0","name":"database","id":0,"eClass":"EPackage"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"DataBaseElement","instanceClass":null,"abstract":true,"id":1,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"instanceClassName":null,"name":"RailsData","instanceClass":null,"id":2,"serializable":true,"eClass":"EEnum"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Schema","instanceClass":null,"abstract":false,"id":3,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Table","instanceClass":null,"abstract":false,"id":4,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"Column","instanceClass":null,"abstract":false,"id":5,"interface":false,"eClass":"EClass"},{"instanceTypeName":null,"defaultValue":null,"instanceClassName":null,"name":"ForeignKey","instanceClass":null,"abstract":false,"id":6,"interface":false,"eClass":"EClass"},{"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"name","changeable":true,"lowerBound":0,"iD":false,"id":7,"derived":false},{"id":8,"eClass":"EGenericType"},{"name":"binary","id":9,"value":0,"literal":"binary","eClass":"EEnumLiteral"},{"name":"boolean","id":10,"value":1,"literal":"boolean","eClass":"EEnumLiteral"},{"name":"date","id":11,"value":2,"literal":"date","eClass":"EEnumLiteral"},{"name":"dateTime","id":12,"value":3,"literal":"dateTime","eClass":"EEnumLiteral"},{"name":"decimal","id":13,"value":4,"literal":"decimal","eClass":"EEnumLiteral"},{"name":"float","id":14,"value":5,"literal":"float","eClass":"EEnumLiteral"},{"name":"integer","id":15,"value":6,"literal":"integer","eClass":"EEnumLiteral"},{"name":"string","id":16,"value":7,"literal":"string","eClass":"EEnumLiteral"},{"name":"text","id":17,"value":8,"literal":"text","eClass":"EEnumLiteral"},{"name":"time","id":18,"value":9,"literal":"time","eClass":"EEnumLiteral"},{"name":"timestamp","id":19,"value":10,"literal":"timestamp","eClass":"EEnumLiteral"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"tables","changeable":true,"resolveProxies":true,"lowerBound":0,"id":20,"derived":false},{"id":21,"eClass":"EGenericType"},{"id":22,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"columns","changeable":true,"resolveProxies":true,"lowerBound":1,"id":23,"derived":false},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"primaryKey","changeable":true,"resolveProxies":true,"lowerBound":1,"id":24,"derived":false},{"container":false,"ordered":true,"upperBound":-1,"defaultValue":null,"volatile":false,"many":true,"required":false,"eClass":"EReference","defaultValueLiteral":null,"containment":true,"unsettable":false,"transient":false,"unique":true,"name":"foreignKeys","changeable":true,"resolveProxies":true,"lowerBound":0,"id":25,"derived":false},{"id":26,"eClass":"EGenericType"},{"id":27,"eClass":"EGenericType"},{"id":28,"eClass":"EGenericType"},{"id":29,"eClass":"EGenericType"},{"ordered":true,"upperBound":1,"volatile":false,"many":false,"required":false,"eClass":"EAttribute","defaultValueLiteral":null,"unsettable":false,"transient":false,"unique":true,"name":"type","changeable":true,"lowerBound":0,"iD":false,"id":30,"derived":false},{"id":31,"eClass":"EGenericType"},{"id":32,"eClass":"EGenericType"},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"column","changeable":true,"resolveProxies":true,"lowerBound":1,"id":33,"derived":false},{"container":false,"ordered":true,"upperBound":1,"defaultValue":null,"volatile":false,"many":false,"required":true,"eClass":"EReference","defaultValueLiteral":null,"containment":false,"unsettable":false,"transient":false,"unique":true,"name":"reference","changeable":true,"resolveProxies":true,"lowerBound":1,"id":34,"derived":false},{"id":35,"eClass":"EGenericType"},{"id":36,"eClass":"EGenericType"}],"links":[{"source":0,"target":1},{"source":0,"target":2},{"source":0,"target":3},{"source":0,"target":4},{"source":0,"target":5},{"source":0,"target":6},{"source":1,"target":0},{"source":1,"target":7},{"source":7,"target":8},{"source":7,"target":1},{"source":2,"target":0},{"source":2,"target":9},{"source":2,"target":10},{"source":2,"target":11},{"source":2,"target":12},{"source":2,"target":13},{"source":2,"target":14},{"source":2,"target":15},{"source":2,"target":16},{"source":2,"target":17},{"source":2,"target":18},{"source":2,"target":19},{"source":9,"target":2},{"source":10,"target":2},{"source":11,"target":2},{"source":12,"target":2},{"source":13,"target":2},{"source":14,"target":2},{"source":15,"target":2},{"source":16,"target":2},{"source":17,"target":2},{"source":18,"target":2},{"source":19,"target":2},{"source":3,"target":0},{"source":3,"target":1},{"source":3,"target":20},{"source":3,"target":21},{"source":20,"target":4},{"source":20,"target":22},{"source":20,"target":3},{"source":22,"target":4},{"source":21,"target":1},{"source":4,"target":0},{"source":4,"target":1},{"source":4,"target":23},{"source":4,"target":24},{"source":4,"target":25},{"source":4,"target":26},{"source":23,"target":5},{"source":23,"target":27},{"source":23,"target":4},{"source":27,"target":5},{"source":24,"target":5},{"source":24,"target":28},{"source":24,"target":4},{"source":28,"target":5},{"source":25,"target":6},{"source":25,"target":29},{"source":25,"target":4},{"source":29,"target":6},{"source":26,"target":1},{"source":5,"target":0},{"source":5,"target":1},{"source":5,"target":30},{"source":5,"target":31},{"source":30,"target":2},{"source":30,"target":32},{"source":30,"target":5},{"source":32,"target":2},{"source":31,"target":1},{"source":6,"target":0},{"source":6,"target":33},{"source":6,"target":34},{"source":33,"target":5},{"source":33,"target":35},{"source":33,"target":6},{"source":35,"target":5},{"source":34,"target":4},{"source":34,"target":36},{"source":34,"target":6},{"source":36,"target":4}],"multigraph":true}