mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-08-29 23:17:19 +02:00
- rename podlibre to adaures - rename castopod-host to castopod - simplify README and redirect to docs site - move INSTALL and UPDATE docs - add new gitlabci pipeline to deploy docs - upgrade node to v16 in Dockerfile
86 lines
2.2 KiB
PHP
86 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Class AddPreviewCards Creates preview_cards table in database
|
|
*
|
|
* @copyright 2021 Ad Aures
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace Modules\Fediverse\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddPreviewCards extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
$this->forge->addField([
|
|
'id' => [
|
|
'type' => 'INT',
|
|
'unsigned' => true,
|
|
'auto_increment' => true,
|
|
],
|
|
'url' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 512,
|
|
],
|
|
'title' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 128,
|
|
],
|
|
'description' => [
|
|
'type' => 'TEXT',
|
|
],
|
|
'type' => [
|
|
'type' => 'ENUM',
|
|
'constraint' => ['link', 'video', 'image', 'rich'],
|
|
'default' => 'link',
|
|
],
|
|
'author_name' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 64,
|
|
'null' => true,
|
|
],
|
|
'author_url' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 255,
|
|
'null' => true,
|
|
],
|
|
'provider_name' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 255,
|
|
],
|
|
'provider_url' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 255,
|
|
],
|
|
'image' => [
|
|
'type' => 'VARCHAR',
|
|
'constraint' => 255,
|
|
],
|
|
'html' => [
|
|
'type' => 'TEXT',
|
|
],
|
|
'updated_at' => [
|
|
'type' => 'DATETIME',
|
|
],
|
|
'created_at' => [
|
|
'type' => 'DATETIME',
|
|
],
|
|
]);
|
|
|
|
$this->forge->addPrimaryKey('id');
|
|
$this->forge->addUniqueKey('url');
|
|
$this->forge->createTable(config('Fediverse')->tablesPrefix . 'preview_cards');
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->forge->dropTable(config('Fediverse')->tablesPrefix . 'preview_cards');
|
|
}
|
|
}
|