addSql('ALTER TABLE users ALTER attributes DROP NOT NULL'); } public function getDescription(): string { return 'Force user attribute to be an array'; } public function up(Schema $schema): void { $this->addSql('UPDATE users SET attributes = \'{}\'::jsonb WHERE attributes IS NULL'); $this->addSql('ALTER TABLE users ALTER attributes SET NOT NULL'); $this->addSql('ALTER TABLE users ALTER attributes SET DEFAULT \'{}\'::jsonb'); } }