[Embed][DB] Renaming the 'file_oembed' table to 'file_embed' on upgrade

This commit is contained in:
Miguel Dantas
2019-07-06 16:52:30 +01:00
committed by Diogo Cordeiro
parent 52819d39d9
commit 2a2b3f72fb
3 changed files with 31 additions and 5 deletions

View File

@@ -73,11 +73,19 @@ class EmbedPlugin extends Plugin
*/
public function onCheckSchema()
{
$this->onEndUpgrade(); // Ensure rename
$schema = Schema::get();
$schema->ensureTable('file_oembed', File_oembed::schemaDef());
$schema->ensureTable('file_embed', File_embed::schemaDef());
return true;
}
public function onEndUpgrade()
{
$schema = Schema::get();
return $schema->renameTable('file_oembed', 'file_embed');
}
/**
* This code executes when GNU social creates the page routing, and we hook
* on this event to add our action handler for Embed.