SchemaMeta

Is a way to modify input that will affect output from SchemaSpy.

All these instructions are defined in xml the schema can be found here

Schema contains documentation but lets go through the above mentioned features.

Add comments/remarks

The xsd currently allows both comments and remarks. However remarks has been deprecated.

So adding a comment will either add, if missing from database, or replace if comments/remarks exist. Supports markdown, example see Add markdown comments using additional metadata

1<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
2    <comments>Database comment</comments>
3    <tables>
4        <table name="ACCOUNT" comments="Table comment">
5            <column name="accountId" comments="Column comment"/>
6        </table>
7    </tables>
8</schemaMeta>

Add relationships

 1<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
 2    <tables>
 3        <table name="AGENT">
 4            <column name="acId" type="INT">
 5                <foreignKey table="ACCOUNT" column="accountId" />
 6            </column>
 7            <column name="coId" type="INT">
 8                <foreignKey table="COMPANY" column="companyId" />
 9            </column>
10        </table>
11    </tables>
12</schemaMeta>

Add remote tables

Specifying the remoteCatalog and remoteSchema attributes on a table makes it a remote table and as such a logical table.

 1<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
 2    <tables>
 3        <table name="CONTRACT" remoteCatalog="other" remoteSchema="other">
 4            <column name="contractId" autoUpdated="true" primaryKey="true" type="INT"/>
 5            <column name="accountId" type="INT">
 6                <foreignKey table="ACCOUNT" column="accountId"/>
 7            </column>
 8            <column name="agentId" type="INT">
 9                <foreignKey table="AGENT" column="aId"/>
10            </column>
11        </table>
12    </tables>
13</schemaMeta>

Add columns

1<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
2    <tables>
3        <table name="ACCOUNT">
4            <column name="this_is_new" type="INT" />
5        </table>
6    </tables>
7</schemaMeta>

Exclude columns from implied relationships

Explicitly disables relationships to or from this column that may be implied by the column’s name, type and size.

Available options: to, from, all, none
Default: none

1<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
2    <tables>
3        <table name="AGENT">
4            <column name="accountId" type="INT" disableImpliedKeys="all"/>
5        </table>
6    </tables>
7</schemaMeta>

Exclude columns from diagrams

Sometimes the associations displayed on a relationships diagram cause the diagram to become much more cluttered than it needs to be. Enable this setting to not show the relationships between this column and other columns.

Use exceptDirect to disable associations on all diagrams except for the diagrams of tables directly (within one degree of separation) connected to this column.

Available options: all, exceptDirect, none
Defaults: none

1<schemaMeta xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schemaspy.org/xsd/6/schemameta.xsd" >
2    <tables>
3        <table name="COUNTRY">
4            <column name="countryId" type="INT" disableDiagramAssociations="all"/>
5        </table>
6    </tables>
7</schemaMeta>