Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimension columns should always be allowed to be NULL in the DB (and should default to NULL) #6207

Closed
diosmosis opened this issue Sep 13, 2014 · 3 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.

Comments

@diosmosis
Copy link
Member

Dimensions are information attached to tracked entity (visits, actions, conversions, whatever). Since they only add context, they are not vital to the entity themselves and thus they should be allowed to be NULL in the DB.

Main use case: will allow easier testing. Not allowing NULL values (and not defaulting to NULL), means dimensions have to be known and data has to be specified for them when inserting test data. This becomes more of a problem when you consider that the dimensions loaded depend on the plugins loaded. If a new dimension is created or new core plugin w/ dimension created, all plugin unit tests that insert data will break.

@mattab Please tell me your thoughts on this, I would like to make this change soon.

CC @tsteur

@mattab mattab added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Sep 14, 2014
@mattab mattab added this to the Short term milestone Sep 14, 2014
@mattab
Copy link
Member

mattab commented Sep 14, 2014

Maybe you could list what current dimensions do not allow NULL? I guess there are no good cases for it but would good to see the list.

In general +1, added to Short term (feel free to assign to yourself to flag it to you as important?)

@diosmosis
Copy link
Member Author

grepping for 'columnType\s_=._NOT NULL' results in:

plugins/Actions/Columns/VisitTotalSearches.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/Actions/Columns/ExitPageTitle.php:    protected $columnType = 'INTEGER(11) UNSIGNED NOT NULL';
plugins/Actions/Columns/VisitTotalActions.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/Actions/Columns/EntryPageTitle.php:    protected $columnType = 'INTEGER(11) UNSIGNED NOT NULL';
plugins/Actions/Columns/EntryPageUrl.php:    protected $columnType = 'INTEGER(11) UNSIGNED NOT NULL';
plugins/Actions/Columns/TimeSpentRefAction.php:    protected $columnType = 'INTEGER(10) UNSIGNED NOT NULL';
plugins/UserCountry/Columns/Country.php:    protected $columnType = 'CHAR(3) NOT NULL';
plugins/VisitTime/Columns/LocalTime.php:    protected $columnType = 'TIME NOT NULL';
plugins/Events/Columns/TotalEvents.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/ExampleTracker/Columns/ExampleConversionDimension.php:    protected $columnType = 'INTEGER(11) DEFAULT 0 NOT NULL';
plugins/ExampleTracker/Columns/ExampleVisitDimension.php:    protected $columnType = 'INTEGER(11) DEFAULT 0 NOT NULL';
plugins/CoreHome/Columns/VisitTotalTime.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/CoreHome/Columns/VisitGoalBuyer.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/CoreHome/Columns/ServerTime.php:    protected $columnType = 'DATETIME NOT NULL';
plugins/CoreHome/Columns/VisitFirstActionTime.php:    protected $columnType = 'DATETIME NOT NULL';
plugins/CoreHome/Columns/VisitorDaysSinceFirst.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/CoreHome/Columns/VisitGoalConverted.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/CoreHome/Columns/VisitorReturning.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/CoreHome/Columns/VisitsCount.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/CoreHome/Columns/VisitorDaysSinceOrder.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/VisitorInterest/Columns/VisitsByDaysSinceLastVisit.php:    protected $columnType = 'SMALLINT(5) UNSIGNED NOT NULL';
plugins/UserSettings/Columns/PluginQuickTime.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/PluginPdf.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/Browser.php:    protected $columnType = 'VARCHAR(10) NOT NULL';
plugins/UserSettings/Columns/PluginSilverlight.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/PluginRealPlayer.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/PluginCookie.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/PluginJava.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/Operatingsystem.php:    protected $columnType = 'CHAR(3) NOT NULL';
plugins/UserSettings/Columns/PluginGears.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/BrowserVersion.php:    protected $columnType = 'VARCHAR(20) NOT NULL';
plugins/UserSettings/Columns/Language.php:    protected $columnType = 'VARCHAR(20) NOT NULL';
plugins/UserSettings/Columns/PluginFlash.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/PluginDirector.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/PluginWindowsMedia.php:    protected $columnType = 'TINYINT(1) NOT NULL';
plugins/UserSettings/Columns/Resolution.php:    protected $columnType = 'VARCHAR(9) NOT NULL';
plugins/Referrers/Columns/ReferrerUrl.php:    protected $columnType = 'TEXT NOT NULL';

@mattab mattab modified the milestones: Mid term, Short term Sep 30, 2014
@mattab mattab modified the milestones: 3.0.0, Long term May 5, 2016
@tsteur
Copy link
Member

tsteur commented Dec 19, 2016

fixed in #10492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants