Skip to content
Snippets Groups Projects
2020-06-05-190000_add_platforms.php 1.43 KiB
Newer Older
  • Learn to ignore specific revisions
  • <?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([
                'id' => [
    
                    'unsigned' => true,
                    'auto_increment' => true,
                ],
                'name' => [
                    'type' => 'VARCHAR',
    
                    'unique' => true,
                ],
    
                    'type' => 'VARCHAR',
    
                    'type' => 'VARCHAR',
    
                'submit_url' => [
    
                    'type' => 'VARCHAR',
    
                    'null' => true,
    
                    'default' => null,
    
                ],
                'created_at' => [
    
                ],
                'updated_at' => [
    
                ],
            ]);
            $this->forge->addKey('id', true);
            $this->forge->createTable('platforms');
        }
    
        public function down()
        {
            $this->forge->dropTable('platforms');
        }
    }