Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2234

Extension Writers Discussion • Migration Code Problem

$
0
0
I have a Toggle Dark Style extension created but I'm having a problem getting the migration file to work.
  1. In the phpbb_users table, I have all the user_dark_style values set to 0 on all users.
  2. When this extension is enabled I'm trying to get it to change that 0 to 1 on all users.
  3. I'm hoping someone can point out exactly what I'm doing wrong in these codes below.
The codes I'm using in the /ext/sniper/toggledark/migrations/toggledark_schema.php file.

Code:

namespace sniper\toggledark\migrations;class toggledark_schema extends \phpbb\db\migration\migration{public static function depends_on(){return [ '\phpbb\db\migration\data\v33x\v331' ];}public function update_schema(){return array('update_columns'=> array($this->table_prefix . 'users'=> array('user_dark_style'  => array('BOOL', 1),),),);}}
I have tried everything I could, except the right thing. I've referenced a dozen other extensions for an example, but no luck.

Statistics: Posted by Sniper_E — Tue Mar 11, 2025 5:17 am



Viewing all articles
Browse latest Browse all 2234

Trending Articles