Skip to content
Snippets Groups Projects
2021-03-09-113000_add_created_by_to_statuses.php 1.04 KiB
Newer Older
  • Learn to ignore specific revisions
  •  * Class AddCreatedByToStatuses Adds created_by field to activitypub_statuses 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 AddCreatedByToStatuses extends Migration
    
                ALTER TABLE {$prefix}activitypub_statuses
    
                ADD COLUMN `created_by` INT UNSIGNED AFTER `episode_id`,
    
                ADD FOREIGN KEY {$prefix}activitypub_statuses_created_by_foreign(created_by) REFERENCES {$prefix}users(id) ON DELETE CASCADE;
    
            $this->forge->dropForeignKey('activitypub_statuses', 'activitypub_statuses_created_by_foreign');
            $this->forge->dropColumn('activitypub_statuses', 'created_by');