Skip to content
Snippets Groups Projects
2021-06-05-190000_add_platforms.php 1.46 KiB
Newer Older
  • Learn to ignore specific revisions
  • <?php
    
     * Class AddPlatforms Creates platforms 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 CodeIgniter\Database\Migration;
    
    
    class AddPlatforms extends Migration
    {
    
        {
            $this->forge->addField([
    
                    'type' => 'VARCHAR',
    
                ],
                'type' => [
                    'type' => 'ENUM',
                    'constraint' => ['podcasting', 'social', 'funding'],
    
                    'type' => 'VARCHAR',
    
                    'type' => 'VARCHAR',
    
                'submit_url' => [
    
                    'type' => 'VARCHAR',
    
                    '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->dropTable('platforms');
        }
    }