Verified Commit 194b56c8 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3215062 by quietone, gambry, ravi.shankar, dww, daffie, yogeshmpawar,...

Issue #3215062 by quietone, gambry, ravi.shankar, dww, daffie, yogeshmpawar, aarti zikre, alexpott, mfb, larowlan, longwave, catch: Update hook_schema for Y2038
parent fa81e936
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -498,6 +498,7 @@ public function schemaDefinition() {
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'size' => 'big',
        ],
        'created' => [
          'description' => 'A timestamp with millisecond precision indicating when the cache entry was created.',
+2 −0
Original line number Diff line number Diff line
@@ -215,12 +215,14 @@ public function schemaDefinition() {
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'size' => 'big',
        ],
        'expiration' => [
          'description' => 'Expiration timestamp. Expired events are purged on cron run.',
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'size' => 'big',
        ],
      ],
      'primary key' => ['fid'],
+2 −0
Original line number Diff line number Diff line
@@ -333,12 +333,14 @@ public function schemaDefinition() {
          'not null' => TRUE,
          'default' => 0,
          'description' => 'Timestamp when the claim lease expires on the item.',
          'size' => 'big',
        ],
        'created' => [
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
          'description' => 'Timestamp when the item was created.',
          'size' => 'big',
        ],
      ],
      'primary key' => ['item_id'],
+18 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ function comment_schema() {
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.changed.',
        'size' => 'big',
      ],
      'last_comment_name' => [
        'type' => 'varchar',
@@ -116,3 +117,20 @@ function comment_schema() {
function comment_update_last_removed() {
  return 8701;
}

/**
 * Remove the year 2038 date limitation.
 */
function comment_update_10100(&$sandbox = NULL) {
  $connection = \Drupal::database();
  if ($connection->schema()->tableExists('comment_entity_statistics') && $connection->databaseType() != 'sqlite') {
    $new = [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The Unix timestamp of the last comment that was posted within this node, from {comment}.changed.',
        'size' => 'big',
      ];
    $connection->schema()->changeField('comment_entity_statistics', 'last_comment_timestamp', 'last_comment_timestamp', $new);
  }
}
+18 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ function dblog_schema() {
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Unix timestamp of when event occurred.',
        'size' => 'big',
      ],
    ],
    'primary key' => ['wid'],
@@ -97,3 +98,20 @@ function dblog_schema() {
function dblog_update_last_removed() {
  return 8600;
}

/**
 * Remove the year 2038 date limitation.
 */
function dblog_update_10100(&$sandbox = NULL) {
  $connection = \Drupal::database();
  if ($connection->schema()->tableExists('watchdog') && $connection->databaseType() != 'sqlite') {
    $new = [
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
      'description' => 'Unix timestamp of when event occurred.',
      'size' => 'big',
    ];
    $connection->schema()->changeField('watchdog', 'timestamp', 'timestamp', $new);
  }
}
Loading