File modules/cms/update/version/DBVersion000033.class.php

Last commit: Sun Oct 1 02:59:13 2023 +0200	Jan Dankert	New: Fixing the year 2038 problem with 8-byte-integers for the unix timestamps.
1 <?php 2 3 namespace cms\update\version; 4 5 use cms\base\Startup; 6 use database\DbVersion; 7 use database\Column; 8 use security\Password; 9 10 /** 11 * Migrate file values to content. 12 * 13 * @author dankert 14 * 15 */ 16 class DBVersion000033 extends DbVersion 17 { 18 /** 19 * Modify date columns to bigint to fix the year 2038 problem. 20 */ 21 public function update() 22 { 23 foreach( [ 24 $this->table('object' )->column('create_date' ), 25 $this->table('object' )->column('lastchange_date'), 26 $this->table('object' )->column('published_date')->nullable(), 27 $this->table('object' )->column('valid_from')->nullable(), 28 $this->table('object' )->column('valid_to' )->nullable(), 29 $this->table('value' )->column('date')->nullable(), 30 $this->table('value' )->column('lastchange_date'), 31 $this->table('version')->column('installed'), 32 $this->table('user' )->column('password_expires')->nullable(), 33 $this->table('user' )->column('last_login')->nullable(), 34 $this->table('user' )->column('password_locked_until')->nullable(), 35 $this->table('auth' )->column('expires'), 36 $this->table('auth' )->column('create_date'), 37 ] as $column ) { 38 $column->type( Column::TYPE_INT )->size( Column::SIZE_INT_BIG )->modify(); 39 } 40 } 41 } 42
Download modules/cms/update/version/DBVersion000033.class.php
History Sun, 1 Oct 2023 02:59:13 +0200 Jan Dankert New: Fixing the year 2038 problem with 8-byte-integers for the unix timestamps.