Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30149

As a Developer I want uniform eznotification DB table definition across all DBMS-es

    Details

    • Story Points:
      1

      Description

      There are two separate inconsistencies between MySQL and PostgreSQL schema definitions of eznotification table related to is_pending and data columns.

      The schema table definitions are as follows:

      MySQL

      CREATE TABLE `eznotification` (
        `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
        `owner_id` int(11) NOT NULL DEFAULT 0,
        `is_pending` tinyint(1) NOT NULL DEFAULT '1',
        `type` varchar(128) NOT NULL DEFAULT '',
        `created` int(11) NOT NULL DEFAULT 0,
        `data` text,
        PRIMARY KEY (`id`),
        KEY `eznotification_owner` (`owner_id`),
        KEY `eznotification_owner_is_pending` (`owner_id`, `is_pending`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
      

      PostgreSQL

      CREATE TABLE eznotification (
          id SERIAL,
          owner_id integer DEFAULT 0 NOT NULL ,
          is_pending integer DEFAULT 1 NOT NULL,
          type character varying(128) NOT NULL,
          created integer DEFAULT 0 NOT NULL,
          data text
      );
      

      1. The is_pending column has tinyint(1) and integer data types for MySQL and PostgreSQL respectively. Doctrine Schema Tool transforms tinyint(1) to boolean, therefore this should be uniform data type. It's important for PostgreSQL because of strict type comparison in queries, which means Gateway code needs to be adjusted.
      2. The data column has blob and text data types for MySQL and PostgreSQL respectively. The internal stored format is JSON, so the correct data type for this column should be text (also easier to fix, because PostgreSQL Doctrine driver returns blobs as data streams).

        Issue Links

          Activity

          Show
          Andrzej Longosz added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/2550
          Show
          Andrzej Longosz added a comment - Merged: https://github.com/ezsystems/ezpublish-kernel/commit/5acabab0a3d2b5bff064b0cde0298dbef28510b2

            People

            • Assignee:
              Unassigned
              Reporter:
              Andrzej Longosz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: