Skip to content

Instantly share code, notes, and snippets.

View mamazu's full-sized avatar
🏁
Developing open source code.

mamazu mamazu

🏁
Developing open source code.
View GitHub Profile
--- /dev/null
+++ ../src/Sylius/Bundle/CoreBundle/Migrations/Version20240315112656.php
@@ -48,22 +48,50 @@
{
if ($table === 'sylius_address_log_entries') {
$this->addSql(sprintf('ALTER TABLE %s CHANGE %s %s JSON DEFAULT NULL', $table, $dataColumn, $dataColumn));
+
+ $stmt = <<<SQL
+ UPDATE $table
+ SET $dataColumn = REGEXP_REPLACE(
@mamazu
mamazu / Client.php
Created October 11, 2023 21:12
How to recompute references in phpcr.
<?php
namespace Jackalope\Transport\DoctrineDBAL;
class Client extends BaseTransport implements QueryTransport, WritingInterface, WorkspaceManagementInterface, NodeTypeManagementInterface, TransactionInterface
{
// Make this a public static array to be accessible outside the class
public static array $referenceTables = [
PropertyType::REFERENCE => 'phpcr_nodes_references',
PropertyType::WEAKREFERENCE => 'phpcr_nodes_weakreferences',
];
@mamazu
mamazu / generate_config_layout.py
Last active August 29, 2022 13:57
Generating a graph out of the Sulu configuration
import re
import os
import sys
DEBUG = False
# Printing the usage of the program
if len(sys.argv) == 1:
print(
f'''Usage: python3 {sys.argv[0]}