Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • adaures/castopod
  • mkljczk/castopod-host
  • spaetz/castopod-host
  • PatrykMis/castopod
  • jonas/castopod
  • ajeremias/castopod
  • misuzu/castopod
  • KrzysztofDomanczyk/castopod
  • Behel/castopod
  • nebulon/castopod
  • ewen/castopod
  • NeoluxConsulting/castopod
  • nateritter/castopod-og
  • prcutler/castopod
14 results
Show changes
Showing
with 672 additions and 175 deletions
...@@ -5,43 +5,44 @@ declare(strict_types=1); ...@@ -5,43 +5,44 @@ declare(strict_types=1);
/** /**
* Class AddEpisodes Creates episodes table in database * Class AddEpisodes Creates episodes table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddEpisodes extends Migration class AddEpisodes extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'podcast_id' => [ 'podcast_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'guid' => [ 'guid' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 255, 'constraint' => 255,
], ],
'title' => [ 'title' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 128, 'constraint' => 128,
], ],
'slug' => [ 'slug' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 128, 'constraint' => 128,
], ],
'audio_id' => [ 'audio_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'description_markdown' => [ 'description_markdown' => [
...@@ -51,90 +52,95 @@ class AddEpisodes extends Migration ...@@ -51,90 +52,95 @@ class AddEpisodes extends Migration
'type' => 'TEXT', 'type' => 'TEXT',
], ],
'cover_id' => [ 'cover_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'transcript_id' => [ 'transcript_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'transcript_remote_url' => [ 'transcript_remote_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 512, 'constraint' => 512,
'null' => true, 'null' => true,
], ],
'chapters_id' => [ 'chapters_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'chapters_remote_url' => [ 'chapters_remote_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 512, 'constraint' => 512,
'null' => true, 'null' => true,
], ],
'parental_advisory' => [ 'parental_advisory' => [
'type' => 'ENUM', 'type' => 'ENUM',
'constraint' => ['clean', 'explicit'], 'constraint' => ['clean', 'explicit'],
'null' => true, 'null' => true,
], ],
'number' => [ 'number' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'season_number' => [ 'season_number' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'type' => [ 'type' => [
'type' => 'ENUM', 'type' => 'ENUM',
'constraint' => ['trailer', 'full', 'bonus'], 'constraint' => ['trailer', 'full', 'bonus'],
'default' => 'full', 'default' => 'full',
], ],
'is_blocked' => [ 'is_blocked' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
], ],
'location_name' => [ 'location_name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 128, 'constraint' => 128,
'null' => true, 'null' => true,
], ],
'location_geo' => [ 'location_geo' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
'null' => true, 'null' => true,
], ],
'location_osm' => [ 'location_osm' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 12, 'constraint' => 12,
'null' => true, 'null' => true,
], ],
'custom_rss' => [ 'custom_rss' => [
'type' => 'JSON', 'type' => 'JSON',
'null' => true, 'null' => true,
], ],
'posts_count' => [ 'posts_count' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'default' => 0, 'default' => 0,
], ],
'comments_count' => [ 'comments_count' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'default' => 0, 'default' => 0,
],
'is_premium' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
], ],
'created_by' => [ 'created_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'updated_by' => [ 'updated_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'published_at' => [ 'published_at' => [
...@@ -147,10 +153,6 @@ class AddEpisodes extends Migration ...@@ -147,10 +153,6 @@ class AddEpisodes extends Migration
'updated_at' => [ 'updated_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
], ],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]); ]);
$this->forge->addPrimaryKey('id'); $this->forge->addPrimaryKey('id');
$this->forge->addUniqueKey(['podcast_id', 'slug']); $this->forge->addUniqueKey(['podcast_id', 'slug']);
...@@ -162,8 +164,17 @@ class AddEpisodes extends Migration ...@@ -162,8 +164,17 @@ class AddEpisodes extends Migration
$this->forge->addForeignKey('created_by', 'users', 'id'); $this->forge->addForeignKey('created_by', 'users', 'id');
$this->forge->addForeignKey('updated_by', 'users', 'id'); $this->forge->addForeignKey('updated_by', 'users', 'id');
$this->forge->createTable('episodes'); $this->forge->createTable('episodes');
// Add Full-Text Search index on title and description_markdown
$prefix = $this->db->getPrefix();
$createQuery = <<<SQL
ALTER TABLE {$prefix}episodes
ADD FULLTEXT title (title, description_markdown);
SQL;
$this->db->query($createQuery);
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('episodes'); $this->forge->dropTable('episodes');
......
...@@ -5,48 +5,52 @@ declare(strict_types=1); ...@@ -5,48 +5,52 @@ declare(strict_types=1);
/** /**
* Class AddPlatforms Creates platforms table in database * Class AddPlatforms Creates platforms table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddPlatforms extends Migration class AddPlatforms extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'slug' => [ 'slug' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
'type' => [ 'type' => [
'type' => 'ENUM', 'type' => 'ENUM',
'constraint' => ['podcasting', 'social', 'funding'], 'constraint' => ['podcasting', 'social', 'funding'],
], ],
'label' => [ 'label' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
'home_url' => [ 'home_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 255, 'constraint' => 255,
], ],
'submit_url' => [ 'submit_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 512, 'constraint' => 512,
'null' => true, 'null' => true,
], ],
]); ]);
$this->forge->addField('`created_at` timestamp NOT NULL DEFAULT NOW()'); $this->forge->addField('`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP()');
$this->forge->addField('`updated_at` timestamp NOT NULL DEFAULT NOW() ON UPDATE NOW()'); $this->forge->addField(
'`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()',
);
$this->forge->addPrimaryKey('slug'); $this->forge->addPrimaryKey('slug');
$this->forge->createTable('platforms'); $this->forge->createTable('platforms');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('platforms'); $this->forge->dropTable('platforms');
......
...@@ -5,46 +5,47 @@ declare(strict_types=1); ...@@ -5,46 +5,47 @@ declare(strict_types=1);
/** /**
* Class AddAddPodcastsPlatforms Creates podcasts_platforms table in database * Class AddAddPodcastsPlatforms Creates podcasts_platforms table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddPodcastsPlatforms extends Migration class AddPodcastsPlatforms extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'podcast_id' => [ 'podcast_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'platform_slug' => [ 'platform_slug' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
'link_url' => [ 'link_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 512, 'constraint' => 512,
], ],
'account_id' => [ 'account_id' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 128, 'constraint' => 128,
'null' => true, 'null' => true,
], ],
'is_visible' => [ 'is_visible' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
], ],
'is_on_embed' => [ 'is_on_embed' => [
'type' => 'TINYINT', 'type' => 'TINYINT',
'constraint' => 1, 'constraint' => 1,
'default' => 0, 'default' => 0,
], ],
]); ]);
...@@ -54,6 +55,7 @@ class AddPodcastsPlatforms extends Migration ...@@ -54,6 +55,7 @@ class AddPodcastsPlatforms extends Migration
$this->forge->createTable('podcasts_platforms'); $this->forge->createTable('podcasts_platforms');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('podcasts_platforms'); $this->forge->dropTable('podcasts_platforms');
......
...@@ -5,77 +5,76 @@ declare(strict_types=1); ...@@ -5,77 +5,76 @@ declare(strict_types=1);
/** /**
* Class AddEpisodeComments creates episode_comments table in database * Class AddEpisodeComments creates episode_comments table in database
* *
* @copyright 2021 Podlibre * @copyright 2021 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddEpisodeComments extends Migration class AddEpisodeComments extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'BINARY', 'type' => 'BINARY',
'constraint' => 16, 'constraint' => 16,
], ],
'uri' => [ 'uri' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 255, 'constraint' => 255,
], ],
'episode_id' => [ 'episode_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'actor_id' => [ 'actor_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'in_reply_to_id' => [ 'in_reply_to_id' => [
'type' => 'BINARY', 'type' => 'BINARY',
'constraint' => 16, 'constraint' => 16,
'null' => true, 'null' => true,
], ],
'message' => [ 'message' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 5000, 'constraint' => 5000,
], ],
'message_html' => [ 'message_html' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 6000, 'constraint' => 6000,
], ],
'likes_count' => [ 'likes_count' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'replies_count' => [ 'replies_count' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'created_at' => [ 'created_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
], ],
'created_by' => [ 'created_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
]); ]);
$fediverseTablesPrefix = config('Fediverse')
->tablesPrefix;
$this->forge->addPrimaryKey('id'); $this->forge->addPrimaryKey('id');
$this->forge->addForeignKey('episode_id', 'episodes', 'id', '', 'CASCADE'); $this->forge->addForeignKey('episode_id', 'episodes', 'id', '', 'CASCADE');
$this->forge->addForeignKey('actor_id', $fediverseTablesPrefix . 'actors', 'id', '', 'CASCADE'); $this->forge->addForeignKey('actor_id', 'fediverse_actors', 'id', '', 'CASCADE');
$this->forge->addForeignKey('created_by', 'users', 'id'); $this->forge->addForeignKey('created_by', 'users', 'id');
$this->forge->createTable('episode_comments'); $this->forge->createTable('episode_comments');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('episode_comments'); $this->forge->dropTable('episode_comments');
......
...@@ -5,40 +5,39 @@ declare(strict_types=1); ...@@ -5,40 +5,39 @@ declare(strict_types=1);
/** /**
* Class AddLikes Creates likes table in database * Class AddLikes Creates likes table in database
* *
* @copyright 2021 Podlibre * @copyright 2021 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddLikes extends Migration class AddLikes extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'actor_id' => [ 'actor_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'comment_id' => [ 'comment_id' => [
'type' => 'BINARY', 'type' => 'BINARY',
'constraint' => 16, 'constraint' => 16,
], ],
]); ]);
$fediverseTablesPrefix = config('Fediverse')
->tablesPrefix;
$this->forge->addField('`created_at` timestamp NOT NULL DEFAULT current_timestamp()'); $this->forge->addField('`created_at` timestamp NOT NULL DEFAULT current_timestamp()');
$this->forge->addPrimaryKey(['actor_id', 'comment_id']); $this->forge->addPrimaryKey(['actor_id', 'comment_id']);
$this->forge->addForeignKey('actor_id', $fediverseTablesPrefix . 'actors', 'id', '', 'CASCADE'); $this->forge->addForeignKey('actor_id', 'fediverse_actors', 'id', '', 'CASCADE');
$this->forge->addForeignKey('comment_id', 'episode_comments', 'id', '', 'CASCADE'); $this->forge->addForeignKey('comment_id', 'episode_comments', 'id', '', 'CASCADE');
$this->forge->createTable('likes'); $this->forge->createTable('likes');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('likes'); $this->forge->dropTable('likes');
......
...@@ -5,33 +5,34 @@ declare(strict_types=1); ...@@ -5,33 +5,34 @@ declare(strict_types=1);
/** /**
* Class AddPages Creates pages table in database * Class AddPages Creates pages table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddPages extends Migration class AddPages extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'title' => [ 'title' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 255, 'constraint' => 255,
], ],
'slug' => [ 'slug' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 128, 'constraint' => 128,
'unique' => true, 'unique' => true,
], ],
'content_markdown' => [ 'content_markdown' => [
'type' => 'TEXT', 'type' => 'TEXT',
...@@ -45,15 +46,12 @@ class AddPages extends Migration ...@@ -45,15 +46,12 @@ class AddPages extends Migration
'updated_at' => [ 'updated_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
], ],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]); ]);
$this->forge->addPrimaryKey('id'); $this->forge->addPrimaryKey('id');
$this->forge->createTable('pages'); $this->forge->createTable('pages');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('pages'); $this->forge->dropTable('pages');
......
...@@ -5,26 +5,27 @@ declare(strict_types=1); ...@@ -5,26 +5,27 @@ declare(strict_types=1);
/** /**
* Class AddPodcastsCategories Creates podcasts_categories table in database * Class AddPodcastsCategories Creates podcasts_categories table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddPodcastsCategories extends Migration class AddPodcastsCategories extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'podcast_id' => [ 'podcast_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'category_id' => [ 'category_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
]); ]);
...@@ -34,6 +35,7 @@ class AddPodcastsCategories extends Migration ...@@ -34,6 +35,7 @@ class AddPodcastsCategories extends Migration
$this->forge->createTable('podcasts_categories'); $this->forge->createTable('podcasts_categories');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('podcasts_categories'); $this->forge->dropTable('podcasts_categories');
......
...@@ -3,72 +3,73 @@ ...@@ -3,72 +3,73 @@
declare(strict_types=1); declare(strict_types=1);
/** /**
* @copyright 2021 Podlibre * @copyright 2021 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddClips extends Migration class AddClips extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'podcast_id' => [ 'podcast_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'episode_id' => [ 'episode_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'start_time' => [ 'start_time' => [
'type' => 'DECIMAL(8,3)', 'type' => 'DECIMAL(8,3)',
'unsigned' => true, 'unsigned' => true,
], ],
'duration' => [ 'duration' => [
// clip duration cannot be higher than 9999,999 seconds ~ 2.77 hours // clip duration cannot be higher than 9999,999 seconds ~ 2.77 hours
'type' => 'DECIMAL(7,3)', 'type' => 'DECIMAL(7,3)',
'unsigned' => true, 'unsigned' => true,
], ],
'title' => [ 'title' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 128, 'constraint' => 128,
], ],
'type' => [ 'type' => [
'type' => 'ENUM', 'type' => 'ENUM',
'constraint' => ['audio', 'video'], 'constraint' => ['audio', 'video'],
], ],
'media_id' => [ 'media_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'metadata' => [ 'metadata' => [
'type' => 'JSON', 'type' => 'JSON',
'null' => true, 'null' => true,
], ],
'status' => [ 'status' => [
'type' => 'ENUM', 'type' => 'ENUM',
'constraint' => ['queued', 'pending', 'running', 'passed', 'failed'], 'constraint' => ['queued', 'pending', 'running', 'passed', 'failed'],
], ],
'logs' => [ 'logs' => [
'type' => 'TEXT', 'type' => 'TEXT',
], ],
'created_by' => [ 'created_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'updated_by' => [ 'updated_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'job_started_at' => [ 'job_started_at' => [
...@@ -96,6 +97,7 @@ class AddClips extends Migration ...@@ -96,6 +97,7 @@ class AddClips extends Migration
$this->forge->createTable('clips'); $this->forge->createTable('clips');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('clips'); $this->forge->dropTable('clips');
......
...@@ -5,54 +5,54 @@ declare(strict_types=1); ...@@ -5,54 +5,54 @@ declare(strict_types=1);
/** /**
* Class Persons Creates persons table in database * Class Persons Creates persons table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddPersons extends Migration class AddPersons extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'full_name' => [ 'full_name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 192, 'constraint' => 192,
'comment' => 'This is the full name or alias of the person.', 'comment' => 'This is the full name or alias of the person.',
], ],
'unique_name' => [ 'unique_name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 192, 'constraint' => 192,
'comment' => 'This is the slug name or alias of the person.', 'comment' => 'This is the slug name or alias of the person.',
'unique' => true, 'unique' => true,
], ],
'information_url' => [ 'information_url' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 512, 'constraint' => 512,
'comment' => 'comment' => 'The url to a relevant resource of information about the person, such as a homepage or third-party profile platform.',
'The url to a relevant resource of information about the person, such as a homepage or third-party profile platform.', 'null' => true,
'null' => true,
], ],
'avatar_id' => [ 'avatar_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'null' => true, 'null' => true,
], ],
'created_by' => [ 'created_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'updated_by' => [ 'updated_by' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'created_at' => [ 'created_at' => [
...@@ -70,6 +70,7 @@ class AddPersons extends Migration ...@@ -70,6 +70,7 @@ class AddPersons extends Migration
$this->forge->createTable('persons'); $this->forge->createTable('persons');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('persons'); $this->forge->dropTable('persons');
......
...@@ -5,39 +5,40 @@ declare(strict_types=1); ...@@ -5,39 +5,40 @@ declare(strict_types=1);
/** /**
* Class AddPodcastsPersons Creates podcasts_persons table in database * Class AddPodcastsPersons Creates podcasts_persons table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddPodcastsPersons extends Migration class AddPodcastsPersons extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'podcast_id' => [ 'podcast_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'person_id' => [ 'person_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'person_group' => [ 'person_group' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
'person_role' => [ 'person_role' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
]); ]);
...@@ -48,6 +49,7 @@ class AddPodcastsPersons extends Migration ...@@ -48,6 +49,7 @@ class AddPodcastsPersons extends Migration
$this->forge->createTable('podcasts_persons'); $this->forge->createTable('podcasts_persons');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('podcasts_persons'); $this->forge->dropTable('podcasts_persons');
......
...@@ -5,43 +5,44 @@ declare(strict_types=1); ...@@ -5,43 +5,44 @@ declare(strict_types=1);
/** /**
* Class AddEpisodesPersons Creates episodes_persons table in database * Class AddEpisodesPersons Creates episodes_persons table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddEpisodesPersons extends Migration class AddEpisodesPersons extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'podcast_id' => [ 'podcast_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'episode_id' => [ 'episode_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'person_id' => [ 'person_id' => [
'type' => 'INT', 'type' => 'INT',
'unsigned' => true, 'unsigned' => true,
], ],
'person_group' => [ 'person_group' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
'person_role' => [ 'person_role' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 32, 'constraint' => 32,
], ],
]); ]);
...@@ -53,6 +54,7 @@ class AddEpisodesPersons extends Migration ...@@ -53,6 +54,7 @@ class AddEpisodesPersons extends Migration
$this->forge->createTable('episodes_persons'); $this->forge->createTable('episodes_persons');
} }
#[Override]
public function down(): void public function down(): void
{ {
$this->forge->dropTable('episodes_persons'); $this->forge->dropTable('episodes_persons');
......
...@@ -3,19 +3,18 @@ ...@@ -3,19 +3,18 @@
declare(strict_types=1); declare(strict_types=1);
/** /**
* Class AddCreditView Creates Credit View in database * @copyright 2020 Ad Aures
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddCreditView extends Migration class AddCreditsView extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
// Creates View for credit UNION query // Creates View for credit UNION query
...@@ -24,7 +23,7 @@ class AddCreditView extends Migration ...@@ -24,7 +23,7 @@ class AddCreditView extends Migration
$podcastPersonsTable = $this->db->prefixTable('podcasts_persons'); $podcastPersonsTable = $this->db->prefixTable('podcasts_persons');
$episodePersonsTable = $this->db->prefixTable('episodes_persons'); $episodePersonsTable = $this->db->prefixTable('episodes_persons');
$episodesTable = $this->db->prefixTable('episodes'); $episodesTable = $this->db->prefixTable('episodes');
$createQuery = <<<CODE_SAMPLE $createQuery = <<<SQL
CREATE VIEW `{$viewName}` AS CREATE VIEW `{$viewName}` AS
SELECT `person_group`, `person_id`, `full_name`, `person_role`, `podcast_id`, NULL AS `episode_id` FROM `{$podcastPersonsTable}` SELECT `person_group`, `person_id`, `full_name`, `person_role`, `podcast_id`, NULL AS `episode_id` FROM `{$podcastPersonsTable}`
INNER JOIN `{$personsTable}` INNER JOIN `{$personsTable}`
...@@ -35,12 +34,13 @@ class AddCreditView extends Migration ...@@ -35,12 +34,13 @@ class AddCreditView extends Migration
ON (`person_id`=`{$personsTable}`.`id`) ON (`person_id`=`{$personsTable}`.`id`)
INNER JOIN `{$episodesTable}` INNER JOIN `{$episodesTable}`
ON (`episode_id`=`{$episodesTable}`.`id`) ON (`episode_id`=`{$episodesTable}`.`id`)
WHERE `{$episodesTable}`.published_at <= NOW() WHERE `{$episodesTable}`.published_at <= UTC_TIMESTAMP()
ORDER BY `person_group`, `full_name`, `person_role`, `podcast_id`, `episode_id`; ORDER BY `person_group`, `full_name`, `person_role`, `podcast_id`, `episode_id`;
CODE_SAMPLE; SQL;
$this->db->query($createQuery); $this->db->query($createQuery);
} }
#[Override]
public function down(): void public function down(): void
{ {
$viewName = $this->db->prefixTable('credits'); $viewName = $this->db->prefixTable('credits');
......
...@@ -5,40 +5,48 @@ declare(strict_types=1); ...@@ -5,40 +5,48 @@ declare(strict_types=1);
/** /**
* Class AddEpisodeIdToPosts Adds episode_id field to posts table in database * Class AddEpisodeIdToPosts Adds episode_id field to posts table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddEpisodeIdToPosts extends Migration class AddEpisodeIdToPosts extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$prefix = $this->db->getPrefix(); $prefix = $this->db->getPrefix();
$fediverseTablesPrefix = config('Fediverse')
->tablesPrefix; $this->forge->addColumn('fediverse_posts', [
'episode_id' => [
$createQuery = <<<CODE_SAMPLE 'type' => 'INT',
ALTER TABLE {$prefix}{$fediverseTablesPrefix}posts 'unsigned' => true,
ADD COLUMN `episode_id` INT UNSIGNED NULL AFTER `replies_count`, 'null' => true,
ADD FOREIGN KEY {$prefix}{$fediverseTablesPrefix}posts_episode_id_foreign(episode_id) REFERENCES {$prefix}episodes(id) ON DELETE CASCADE; 'after' => 'replies_count',
CODE_SAMPLE; ],
$this->db->query($createQuery); ]);
$this->forge->addForeignKey(
'episode_id',
'episodes',
'id',
'',
'CASCADE',
$prefix . 'fediverse_posts_episode_id_foreign',
);
$this->forge->processIndexes('fediverse_posts');
} }
#[Override]
public function down(): void public function down(): void
{ {
$fediverseTablesPrefix = config('Fediverse') $prefix = $this->db->getPrefix();
->tablesPrefix;
$this->forge->dropForeignKey( $this->forge->dropForeignKey('fediverse_posts', $prefix . 'fediverse_posts_episode_id_foreign');
$fediverseTablesPrefix . 'posts', $this->forge->dropColumn('fediverse_posts', 'episode_id');
$fediverseTablesPrefix . 'posts_episode_id_foreign'
);
$this->forge->dropColumn($fediverseTablesPrefix . 'posts', 'episode_id');
} }
} }
...@@ -5,40 +5,48 @@ declare(strict_types=1); ...@@ -5,40 +5,48 @@ declare(strict_types=1);
/** /**
* Class AddCreatedByToPosts Adds created_by field to posts table in database * Class AddCreatedByToPosts Adds created_by field to posts table in database
* *
* @copyright 2020 Podlibre * @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3 * @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/ * @link https://castopod.org/
*/ */
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use Override;
class AddCreatedByToPosts extends Migration class AddCreatedByToPosts extends BaseMigration
{ {
#[Override]
public function up(): void public function up(): void
{ {
$prefix = $this->db->getPrefix(); $prefix = $this->db->getPrefix();
$fediverseTablesPrefix = config('Fediverse')
->tablesPrefix; $this->forge->addColumn('fediverse_posts', [
'created_by' => [
$createQuery = <<<CODE_SAMPLE 'type' => 'INT',
ALTER TABLE {$prefix}{$fediverseTablesPrefix}posts 'unsigned' => true,
ADD COLUMN `created_by` INT UNSIGNED AFTER `episode_id`, 'null' => true,
ADD FOREIGN KEY {$prefix}{$fediverseTablesPrefix}posts_created_by_foreign(created_by) REFERENCES {$prefix}users(id) ON DELETE CASCADE; 'after' => 'episode_id',
CODE_SAMPLE; ],
$this->db->query($createQuery); ]);
$this->forge->addForeignKey(
'created_by',
'users',
'id',
'',
'CASCADE',
$prefix . 'fediverse_posts_created_by_foreign',
);
$this->forge->processIndexes('fediverse_posts');
} }
#[Override]
public function down(): void public function down(): void
{ {
$fediverseTablesPrefix = config('Fediverse') $prefix = $this->db->getPrefix();
->tablesPrefix;
$this->forge->dropForeignKey( $this->forge->dropForeignKey('fediverse_posts', $prefix . 'fediverse_posts_created_by_foreign');
$fediverseTablesPrefix . 'posts', $this->forge->dropColumn('fediverse_posts', 'created_by');
$fediverseTablesPrefix . 'posts_created_by_foreign'
);
$this->forge->dropColumn($fediverseTablesPrefix . 'posts', 'created_by');
} }
} }
<?php
declare(strict_types=1);
namespace App\Database\Migrations;
use Override;
class AddFullTextSearchIndexes extends BaseMigration
{
#[Override]
public function up(): void
{
$prefix = $this->db->getPrefix();
$createQuery = <<<SQL
ALTER TABLE {$prefix}episodes DROP INDEX title;
SQL;
$this->db->query($createQuery);
$createQuery = <<<SQL
ALTER TABLE {$prefix}episodes
ADD FULLTEXT episodes_search (title, description_markdown, slug, location_name);
SQL;
$this->db->query($createQuery);
$createQuery = <<<SQL
ALTER TABLE {$prefix}podcasts
ADD FULLTEXT podcasts_search (title, description_markdown, handle, location_name);
SQL;
$this->db->query($createQuery);
}
#[Override]
public function down(): void
{
$prefix = $this->db->getPrefix();
$createQuery = <<<SQL
ALTER TABLE {$prefix}episodes
DROP INDEX episodes_search;
SQL;
$this->db->query($createQuery);
$createQuery = <<<SQL
ALTER TABLE {$prefix}podcasts
DROP INDEX podcasts_search;
SQL;
$this->db->query($createQuery);
}
}
<?php
declare(strict_types=1);
namespace App\Database\Migrations;
use Override;
class AddEpisodePreviewId extends BaseMigration
{
#[Override]
public function up(): void
{
$fields = [
'preview_id' => [
'type' => 'BINARY',
'constraint' => 16,
'after' => 'podcast_id',
],
];
$this->forge->addColumn('episodes', $fields);
// set preview_id as unique key
$prefix = $this->db->getPrefix();
$uniquePreviewId = <<<CODE_SAMPLE
ALTER TABLE `{$prefix}episodes`
ADD CONSTRAINT `preview_id` UNIQUE (`preview_id`);
CODE_SAMPLE;
$this->db->query($uniquePreviewId);
}
#[Override]
public function down(): void
{
$fields = ['preview_id'];
$this->forge->dropColumn('episodes', $fields);
}
}
<?php
declare(strict_types=1);
/**
* Class AddPodcastsOwnerEmailRemovedFromFeed adds is_owner_email_removed_from_feed field to podcast table in database
*
* @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations;
use Override;
class AddPodcastsOwnerEmailRemovedFromFeed extends BaseMigration
{
#[Override]
public function up(): void
{
$fields = [
'is_owner_email_removed_from_feed' => [
'type' => 'BOOLEAN',
'null' => false,
'default' => 0,
'after' => 'owner_email',
],
];
$this->forge->addColumn('podcasts', $fields);
}
#[Override]
public function down(): void
{
$fields = ['is_owner_email_removed_from_feed'];
$this->forge->dropColumn('podcasts', $fields);
}
}
<?php
declare(strict_types=1);
/**
* Class AddPodcastsMediumField adds medium field to podcast table in database
*
* @copyright 2020 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations;
use Override;
class AddPodcastsMediumField extends BaseMigration
{
#[Override]
public function up(): void
{
$fields = [
'medium' => [
'type' => "ENUM('podcast','music','audiobook')",
'null' => false,
'default' => 'podcast',
'after' => 'type',
],
];
$this->forge->addColumn('podcasts', $fields);
}
#[Override]
public function down(): void
{
$fields = ['medium'];
$this->forge->dropColumn('podcasts', $fields);
}
}
<?php
declare(strict_types=1);
/**
* Class AddPodcastsVerifyTxtField adds 1 field to podcast table in database to support podcast:txt tag
*
* @copyright 2024 Ad Aures
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations;
use Override;
class AddPodcastsVerifyTxtField extends BaseMigration
{
#[Override]
public function up(): void
{
$fields = [
'verify_txt' => [
'type' => 'TEXT',
'null' => true,
'after' => 'location_osm',
],
];
$this->forge->addColumn('podcasts', $fields);
}
#[Override]
public function down(): void
{
$this->forge->dropColumn('podcasts', 'verify_txt');
}
}
<?php
declare(strict_types=1);
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use Override;
class RefactorPlatforms extends Migration
{
#[Override]
public function up(): void
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'podcast_id' => [
'type' => 'INT',
'unsigned' => true,
],
'type' => [
'type' => 'ENUM',
'constraint' => ['podcasting', 'social', 'funding'],
'after' => 'podcast_id',
],
'slug' => [
'type' => 'VARCHAR',
'constraint' => 32,
],
'link_url' => [
'type' => 'VARCHAR',
'constraint' => 512,
],
'account_id' => [
'type' => 'VARCHAR',
'constraint' => 128,
'null' => true,
],
'is_visible' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
]);
$this->forge->addPrimaryKey('id');
$this->forge->addForeignKey('podcast_id', 'podcasts', 'id', '', 'CASCADE', 'platforms_podcast_id_foreign');
$this->forge->addUniqueKey(['podcast_id', 'type', 'slug']);
$this->forge->createTable('platforms_temp');
$platformsData = $this->db->table('podcasts_platforms')
->select('podcasts_platforms.*, type')
->join('platforms', 'platforms.slug = podcasts_platforms.platform_slug')
->get()
->getResultArray();
$data = [];
foreach ($platformsData as $platformData) {
$data[] = [
'podcast_id' => $platformData['podcast_id'],
'type' => $platformData['type'],
'slug' => $platformData['platform_slug'],
'link_url' => $platformData['link_url'],
'account_id' => $platformData['account_id'],
'is_visible' => $platformData['is_visible'],
];
}
if ($data !== []) {
$this->db->table('platforms_temp')
->insertBatch($data);
}
$this->forge->dropTable('platforms');
$this->forge->dropTable('podcasts_platforms');
$this->forge->renameTable('platforms_temp', 'platforms');
}
#[Override]
public function down(): void
{
// delete platforms
$this->forge->dropTable('platforms');
// recreate platforms and podcasts_platforms tables
$this->forge->addField([
'slug' => [
'type' => 'VARCHAR',
'constraint' => 32,
],
'type' => [
'type' => 'ENUM',
'constraint' => ['podcasting', 'social', 'funding'],
],
'label' => [
'type' => 'VARCHAR',
'constraint' => 32,
],
'home_url' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'submit_url' => [
'type' => 'VARCHAR',
'constraint' => 512,
'null' => true,
],
]);
$this->forge->addField('`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP()');
$this->forge->addField(
'`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP()',
);
$this->forge->addPrimaryKey('slug');
$this->forge->createTable('platforms');
$this->forge->addField([
'podcast_id' => [
'type' => 'INT',
'unsigned' => true,
],
'platform_slug' => [
'type' => 'VARCHAR',
'constraint' => 32,
],
'link_url' => [
'type' => 'VARCHAR',
'constraint' => 512,
],
'account_id' => [
'type' => 'VARCHAR',
'constraint' => 128,
'null' => true,
],
'is_visible' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
'is_on_embed' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
]);
$this->forge->addPrimaryKey(['podcast_id', 'platform_slug']);
$this->forge->addForeignKey('podcast_id', 'podcasts', 'id', '', 'CASCADE');
$this->forge->addForeignKey('platform_slug', 'platforms', 'slug', 'CASCADE');
$this->forge->createTable('podcasts_platforms');
}
}