Archituredocs

Issues reference

Every rule the issues panel and the MCP tool check_database report, with its severity and how to fix it.

Architure checks each database as you edit it on the canvas. The canvas shows the result in the Issues tab of its sidebar, and agents get the same list from check_database, with how to fix each issue. Errors come first, then warnings, then information.

RuleSeverityReports
missing_primary_keyErrorMissing primary key
foreign_key_type_mismatchErrorForeign key type differs from its target
duplicate_nameErrorDuplicate name
reserved_wordErrorReserved word
foreign_key_without_indexWarningForeign key without an index
unknown_data_typeWarningColumn definition type unknown to the dialect
missing_information_typeInformationMissing information type
table_relationship_not_detailedInformationTable relationship not detailed

Each issue names its object as schema.table.column; in the canvas, choosing it selects the object. Rule ids never change: agents and scripts can rely on them.

Errors

missing_primary_key

Error Missing primary key. Every table needs a primary key: mark one column, or several for a composite key.

Mark the column that identifies a row as primary key, usually id. For a link table, mark both foreign key columns: together they form a composite key.

foreign_key_type_mismatch

Error Foreign key type differs from its target. A column relationship joins two columns of different data types (arguments such as a length are ignored).

Give both columns the same type. The check compares canonical names, so int4 and integer match, a serial key matches an integer reference, and lengths such as varchar(20) against varchar(40) are not reported. Arrays must match too.

duplicate_name

Error Duplicate name. Two schemas of the database, two tables of a schema or two columns of a table share a name (without case in MySQL).

Rename one of the two. PostgreSQL compares names with their case (Users and users are different); MySQL ignores case. A duplicate is reported rather than refused, so an import or a paste never fails on it.

reserved_word

Error Reserved word. A schema, table or column is named with a word the dialect reserves, so every query must quote it.

Rename the object, for example user to app_user or order to purchase_order. The words come from the reserved words of PostgreSQL 17 and MySQL 8.4.

Warnings

foreign_key_without_index

Warning Foreign key without an index. No index (and not the primary key) starts with the columns of a foreign key, so joins and deletes on the referenced table scan this one.

Add an index whose first columns are the foreign key's columns, in any order (in the text view, or ask your agent). A foreign key whose columns start the primary key (as in a link table) needs no extra index. The columns of a composite foreign key are checked together.

unknown_data_type

Warning Column definition type unknown to the dialect. A column definition used in the database has a data type the database's dialect does not know, or is defined for another dialect.

Change the column definition's type to one the dialect knows, or use a definition made for this dialect (or portable). Enum definitions are fine: their type is their own name.

Information

missing_information_type

Information Missing information type. A column has no information type, so the diagram cannot colour it and agents cannot tell what it holds.

Choose one of the seven information types. A column linked to a column definition takes the definition's type.

table_relationship_not_detailed

Information Table relationship not detailed. A relationship drawn between two tables is not yet detailed into the columns that implement it.

Select the dashed relationship, choose its Referencing column and Referenced column, then Detail into columns. A many-to-many relationship is detailed with a link table that holds a foreign key to each side.

On this page