[Bridge] Replace zero dates with CURRENT_TIMESTAMP

This commit is contained in:
Hugo Sales 2020-09-07 23:50:49 +00:00 committed by Hugo Sales
parent 6a2a0d4e66
commit 41f90f07b1
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
4 changed files with 4 additions and 4 deletions

View File

@ -188,7 +188,7 @@ class ForeignLink
'profilesync' => ['type' => 'int', 'size' => 'tiny', 'not null' => true, 'default' => 1, 'description' => 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming'],
'last_noticesync' => ['type' => 'datetime', 'description' => 'last time notices were imported'],
'last_friendsync' => ['type' => 'datetime', 'description' => 'last time friends were imported'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'],
],
'primary key' => ['user_id', 'foreign_id', 'service'],

View File

@ -110,7 +110,7 @@ class ForeignService
'id' => ['type' => 'int', 'not null' => true, 'description' => 'numeric key for service'],
'name' => ['type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'name of the service'],
'description' => ['type' => 'varchar', 'length' => 191, 'description' => 'description'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'],
],
'primary key' => ['id'],

View File

@ -99,7 +99,7 @@ class ForeignSubscription
'service' => ['type' => 'int', 'not null' => true, 'description' => 'service where relationship happens'],
'subscriber' => ['type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscriber on foreign service'],
'subscribed' => ['type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscribed user'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
],
'primary key' => ['service', 'subscriber', 'subscribed'],
'foreign keys' => [

View File

@ -123,7 +123,7 @@ class ForeignUser
'service' => ['type' => 'int', 'not null' => true, 'description' => 'foreign key to service'],
'uri' => ['type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'identifying URI'],
'nickname' => ['type' => 'varchar', 'length' => 191, 'description' => 'nickname on foreign service'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'],
],
'primary key' => ['id', 'service'],