2020-06-08 16:25:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Class AddPlatforms
|
|
|
|
* Creates platforms table in database
|
2020-06-10 15:00:12 +00:00
|
|
|
*
|
2020-06-08 16:25:23 +02:00
|
|
|
* @copyright 2020 Podlibre
|
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
2020-06-10 15:00:12 +00:00
|
|
|
|
2020-06-08 16:25:23 +02:00
|
|
|
namespace App\Database\Migrations;
|
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
use CodeIgniter\Database\Migration;
|
2020-06-08 16:25:23 +02:00
|
|
|
|
|
|
|
class AddPlatforms extends Migration
|
|
|
|
{
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
$this->forge->addField([
|
|
|
|
'id' => [
|
|
|
|
'type' => 'BIGINT',
|
|
|
|
'constraint' => 20,
|
|
|
|
'unsigned' => true,
|
|
|
|
'auto_increment' => true,
|
|
|
|
'comment' => 'The platform ID',
|
|
|
|
],
|
|
|
|
'name' => [
|
|
|
|
'type' => 'VARCHAR',
|
|
|
|
'constraint' => 191,
|
|
|
|
'unique' => true,
|
|
|
|
'comment' => 'Platform name.',
|
|
|
|
],
|
|
|
|
'home_url' => [
|
|
|
|
'type' => 'VARCHAR',
|
|
|
|
'constraint' => 191,
|
|
|
|
'comment' => 'Platform home URL.',
|
|
|
|
],
|
|
|
|
'submit_url' => [
|
|
|
|
'type' => 'VARCHAR',
|
|
|
|
'constraint' => 191,
|
|
|
|
'comment' => 'Platform URL to submit podcasts.',
|
|
|
|
'null' => true,
|
|
|
|
],
|
|
|
|
'iosapp_url' => [
|
|
|
|
'type' => 'VARCHAR',
|
|
|
|
'constraint' => 191,
|
|
|
|
'comment' => 'Platform iOS app URL (if any).',
|
|
|
|
'null' => true,
|
|
|
|
],
|
|
|
|
'androidapp_url' => [
|
|
|
|
'type' => 'VARCHAR',
|
|
|
|
'constraint' => 191,
|
|
|
|
'comment' => 'Platform Android app URL (if any).',
|
|
|
|
'null' => true,
|
|
|
|
],
|
|
|
|
'comment' => [
|
|
|
|
'type' => 'TEXT',
|
|
|
|
'comment' => 'Comment.',
|
|
|
|
'null' => true,
|
|
|
|
],
|
|
|
|
'display_by_default' => [
|
|
|
|
'type' => 'TINYINT',
|
|
|
|
'constraint' => 1,
|
|
|
|
'default' => 0,
|
2020-06-10 15:00:12 +00:00
|
|
|
'comment' =>
|
|
|
|
'True if the platform link should be displayed by default.',
|
2020-06-08 16:25:23 +02:00
|
|
|
],
|
|
|
|
'ios_deeplink' => [
|
|
|
|
'type' => 'TINYINT',
|
|
|
|
'constraint' => 1,
|
|
|
|
'default' => 0,
|
|
|
|
'comment' => 'iOS deeplinking for this platform.',
|
|
|
|
],
|
|
|
|
'android_deeplink' => [
|
|
|
|
'type' => 'TINYINT',
|
|
|
|
'constraint' => 1,
|
|
|
|
'default' => 0,
|
2020-06-10 15:00:12 +00:00
|
|
|
'comment' =>
|
|
|
|
'Android deeplinking for this platform: 0=No, 1=Manual, 2=Automatic.',
|
2020-06-08 16:25:23 +02:00
|
|
|
],
|
|
|
|
'logo_file_name' => [
|
|
|
|
'type' => 'VARCHAR',
|
|
|
|
'constraint' => 1024,
|
|
|
|
'comment' => 'The logo for this platform.',
|
|
|
|
],
|
|
|
|
'created_at' => [
|
|
|
|
'type' => 'TIMESTAMP',
|
|
|
|
],
|
|
|
|
'updated_at' => [
|
|
|
|
'type' => 'TIMESTAMP',
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
$this->forge->addKey('id', true);
|
|
|
|
$this->forge->createTable('platforms');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
$this->forge->dropTable('platforms');
|
|
|
|
}
|
|
|
|
}
|