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) {
$query = $this->db->getQueryBuilder();
$query->delete('calendar_invitation_tokens')
$query->delete('calendar_invitations')
->where($query->expr()->lt('expiration',
$query->createNamedParameter($this->timeFactory->getTime())))
->execute();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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