schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

14.02.02 new lint () in error #6

Closed adriens closed 9 years ago

adriens commented 9 years ago

If you create the following pgsql table :

CREATE TABLE test_xml
(
  id integer NOT NULL, -- primary key
  content character varying(100), -- column with non xml data
  content_xml xml, -- column with xml
  CONSTRAINT pk_test PRIMARY KEY (id)
)

The new lint will say :

{
    "severity": "medium",
    "description": "table with all nullable columns",
    "id": "schemacrawler.tools.linter.LinterTableAllNullableColumns",
    "value": "test_xml"
  }

... but the first PK column cannot be null... and still it is detected by this new lint. Does it really have the correct behavior ?

I've just discovered that as it was creating a regression in iur additional-lints :smile:

schemacrawler commented 9 years ago

Acutally, this is not a bug, but a message that could be worded better. Tables that have all columns besides the primary key that are nullable, may contain no useful data, and could indicate a schema design smell. I will change the message to say: "table with all data columns nullable"

adriens commented 9 years ago

ok, explained like that it's much clearer. Thanks for your explanations.