TabularEditor / BestPracticeRules

An official collection of standard Rules for use with Tabular Editor's Best Practice Analyzer.
120 stars 53 forks source link

[Rule Submit] META: Foreign and Primary Keys should be INT #16

Closed Gezahegne closed 6 years ago

Gezahegne commented 7 years ago
"ID": "META:_FOREIGN_AND_PRIMARY_KEYS_SHOULD_BE_INT",
"Name": "META: Foreign and Primary Keys should be INT",
"Category": null,
"Description": "Foreign and Primary Keys should be INT data type. ",
"Severity": 3,
"Scope": "DataColumn, CalculatedColumn, CalculatedTableColumn",
"ScopeString": "Columns",
"Expression": "(Name.ToLower().EndsWith(\"id\") or Name.ToLower().EndsWith(\"key\"))\nand !DataType.ToString().Equals(\"Int64\")",
"FixExpression": null,
"Compatibility": null,
"IsValid": false
otykier commented 6 years ago

This is a matter of data modelling for Tabular. There may be good reasons to have other data types for FK / PK columns than Int64, and as such, this rule will not be added as a standard rule.