mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-11 16:55:46 +00:00

- https://iabtechlab.com/wp-content/uploads/2017/12/Podcast_Measurement_v2-Dec-20-2017.pdf - no IP address is ever stored on the server. Only aggregate data is stored in the dababase. - rolling 24-hour window - castopod does not do pre-load - IP Blacklisting https://github.com/client9/ipcat - user-agent Filtering https://github.com/opawg/user-agents - ignores 2 bytes range "Range: 0-1" (performed by official Apple iOS Podcast app) - in case of partial content, adds up all requests to check >1mn was downloaded - identifying Uniques is done with a combination of IP Address and User Agent - add AMcharts - add some graphs - add regions to analytics - add ipcat blacklist - enhance useragents performances - add filesize and header size in order to calculate 1mn downloads - update publisher ID3 field - update castopod icon - add disclaimer and warning import form translation - update docs/setup-development.md closes #10
145 lines
4.2 KiB
PHP
145 lines
4.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Class AddEpisodes
|
|
* Creates episodes 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 AddEpisodes extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
$this->forge->addField([
|
|
'id' => [
|
|
'type' => 'BIGINT',
|
|
'constraint' => 20,
|
|
'unsigned' => true,
|
|
'auto_increment' => true,
|
|
],
|
|
'podcast_id' => [
|
|
'type' => 'BIGINT',
|
|
'constraint' => 20,
|
|
'unsigned' => true,
|
|
],
|
|
'guid' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 191,
|
|
],
|
|
'title' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 1024,
|
|
],
|
|
'slug' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 191,
|
|
],
|
|
'enclosure_uri' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 1024,
|
|
],
|
|
'enclosure_duration' => [
|
|
'type' => 'INT',
|
|
'constraint' => 10,
|
|
'unsigned' => true,
|
|
'comment' => 'Playtime in seconds',
|
|
],
|
|
'enclosure_mimetype' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 255,
|
|
],
|
|
'enclosure_filesize' => [
|
|
'type' => 'INT',
|
|
'constraint' => 10,
|
|
'unsigned' => true,
|
|
'comment' => 'File size in bytes',
|
|
],
|
|
'enclosure_headersize' => [
|
|
'type' => 'INT',
|
|
'constraint' => 10,
|
|
'unsigned' => true,
|
|
'comment' => 'Header size in bytes',
|
|
],
|
|
'description' => [
|
|
'type' => 'TEXT',
|
|
'null' => true,
|
|
],
|
|
'image_uri' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 1024,
|
|
'null' => true,
|
|
],
|
|
'parental_advisory' => [
|
|
'type' => 'ENUM',
|
|
'constraint' => ['clean', 'explicit'],
|
|
'null' => true,
|
|
'default' => null,
|
|
],
|
|
'number' => [
|
|
'type' => 'INT',
|
|
'constraint' => 10,
|
|
'unsigned' => true,
|
|
'null' => true,
|
|
],
|
|
'season_number' => [
|
|
'type' => 'INT',
|
|
'constraint' => 10,
|
|
'unsigned' => true,
|
|
'null' => true,
|
|
],
|
|
'type' => [
|
|
'type' => 'ENUM',
|
|
'constraint' => ['trailer', 'full', 'bonus'],
|
|
'default' => 'full',
|
|
],
|
|
'block' => [
|
|
'type' => 'TINYINT',
|
|
'constraint' => 1,
|
|
'default' => 0,
|
|
],
|
|
'created_by' => [
|
|
'type' => 'INT',
|
|
'constraint' => 11,
|
|
'unsigned' => true,
|
|
],
|
|
'updated_by' => [
|
|
'type' => 'INT',
|
|
'constraint' => 11,
|
|
'unsigned' => true,
|
|
],
|
|
'published_at' => [
|
|
'type' => 'DATETIME',
|
|
'null' => true,
|
|
],
|
|
'created_at' => [
|
|
'type' => 'TIMESTAMP',
|
|
],
|
|
'updated_at' => [
|
|
'type' => 'TIMESTAMP',
|
|
],
|
|
'deleted_at' => [
|
|
'type' => 'DATETIME',
|
|
'null' => true,
|
|
],
|
|
]);
|
|
$this->forge->addKey('id', true);
|
|
$this->forge->addUniqueKey(['podcast_id', 'slug']);
|
|
$this->forge->addForeignKey('podcast_id', 'podcasts', 'id');
|
|
$this->forge->addForeignKey('created_by', 'users', 'id');
|
|
$this->forge->addForeignKey('updated_by', 'users', 'id');
|
|
$this->forge->createTable('episodes');
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropTable('episodes');
|
|
}
|
|
}
|