Also shorten the name of the invitation tokens

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2018-07-12 12:11:11 +02:00
parent b7de6d7a24
commit daed1bed57
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
7 changed files with 14 additions and 14 deletions

View File

@ -45,7 +45,7 @@ class CleanupInvitationTokenJob extends TimedJob {
public function run($argument) { public function run($argument) {
$query = $this->db->getQueryBuilder(); $query = $this->db->getQueryBuilder();
$query->delete('calendar_invitation_tokens') $query->delete('calendar_invitations')
->where($query->expr()->lt('expiration', ->where($query->expr()->lt('expiration',
$query->createNamedParameter($this->timeFactory->getTime()))) $query->createNamedParameter($this->timeFactory->getTime())))
->execute(); ->execute();

View File

@ -536,7 +536,7 @@ class IMipPlugin extends SabreIMipPlugin {
$uid = $vevent->{'UID'}; $uid = $vevent->{'UID'};
$query = $this->db->getQueryBuilder(); $query = $this->db->getQueryBuilder();
$query->insert('calendar_invitation_tokens') $query->insert('calendar_invitations')
->values([ ->values([
'token' => $query->createNamedParameter($token), 'token' => $query->createNamedParameter($token),
'attendee' => $query->createNamedParameter($attendee), 'attendee' => $query->createNamedParameter($attendee),

View File

@ -162,7 +162,7 @@ class InvitationResponseController extends Controller {
private function getTokenInformation(string $token) { private function getTokenInformation(string $token) {
$query = $this->db->getQueryBuilder(); $query = $this->db->getQueryBuilder();
$query->select('*') $query->select('*')
->from('calendar_invitation_tokens') ->from('calendar_invitations')
->where($query->expr()->eq('token', $query->createNamedParameter($token))); ->where($query->expr()->eq('token', $query->createNamedParameter($token)));
$stmt = $query->execute(); $stmt = $query->execute();
$row = $stmt->fetch(\PDO::FETCH_ASSOC); $row = $stmt->fetch(\PDO::FETCH_ASSOC);

View File

@ -22,8 +22,8 @@ class Version1006Date20180619154313 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */ /** @var ISchemaWrapper $schema */
$schema = $schemaClosure(); $schema = $schemaClosure();
if (!$schema->hasTable('calendar_invitation_tokens')) { if (!$schema->hasTable('calendar_invitations')) {
$table = $schema->createTable('calendar_invitation_tokens'); $table = $schema->createTable('calendar_invitations');
$table->addColumn('id', Type::BIGINT, [ $table->addColumn('id', Type::BIGINT, [
'autoincrement' => true, 'autoincrement' => true,
@ -62,8 +62,8 @@ class Version1006Date20180619154313 extends SimpleMigrationStep {
'unsigned' => true, 'unsigned' => true,
]); ]);
$table->setPrimaryKey(['id'], 'calendar_invitation_tokens_id_idx'); $table->setPrimaryKey(['id']);
$table->addIndex(['token'], 'calendar_invitation_tokens_token_idx'); $table->addIndex(['token'], 'calendar_invitation_tokens');
return $schema; return $schema;
} }

View File

@ -84,7 +84,7 @@ class CleanupInvitationTokenJobTest extends TestCase {
$queryBuilder->expects($this->at(0)) $queryBuilder->expects($this->at(0))
->method('delete') ->method('delete')
->with('calendar_invitation_tokens') ->with('calendar_invitations')
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(3)) $queryBuilder->expects($this->at(3))
->method('where') ->method('where')

View File

@ -96,7 +96,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0)) $queryBuilder->expects($this->at(0))
->method('insert') ->method('insert')
->with('calendar_invitation_tokens') ->with('calendar_invitations')
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8)) $queryBuilder->expects($this->at(8))
->method('values') ->method('values')
@ -176,7 +176,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0)) $queryBuilder->expects($this->at(0))
->method('insert') ->method('insert')
->with('calendar_invitation_tokens') ->with('calendar_invitations')
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8)) $queryBuilder->expects($this->at(8))
->method('values') ->method('values')
@ -264,7 +264,7 @@ class IMipPluginTest extends TestCase {
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(0)) $queryBuilder->expects($this->at(0))
->method('insert') ->method('insert')
->with('calendar_invitation_tokens') ->with('calendar_invitations')
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(8)) $queryBuilder->expects($this->at(8))
->method('values') ->method('values')

View File

@ -438,7 +438,7 @@ EOF;
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(1)) $queryBuilder->expects($this->at(1))
->method('from') ->method('from')
->with('calendar_invitation_tokens') ->with('calendar_invitations')
->will($this->returnValue($queryBuilder)); ->will($this->returnValue($queryBuilder));
$queryBuilder->expects($this->at(4)) $queryBuilder->expects($this->at(4))
->method('where') ->method('where')