mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-13 09:45:47 +00:00

- add podcast:id tag - add podcast:funding tag - add podcast:social tag - add podcast:previousUrl tag - add missing platforms with icons - update platforms table to include social and funding platforms - rename platform_links table to podcasts_platforms - move podcast import methods from podcast controller - update import functionality to insert platforms from rss closes #73, #75, #76, #80
59 lines
1.5 KiB
PHP
59 lines
1.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Class AddPlatforms
|
|
* Creates platforms table in database
|
|
*
|
|
* @copyright 2020 Podlibre
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddPlatforms extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$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,
|
|
'default' => null,
|
|
],
|
|
]);
|
|
$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->addKey('slug', true);
|
|
$this->forge->createTable('platforms');
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropTable('platforms');
|
|
}
|
|
}
|