From d3b79a725d66f696e256ad3e10d1867d3c5409bd Mon Sep 17 00:00:00 2001
From: llaffont <llaffont@afi-sa.fr>
Date: Sat, 7 Mar 2015 11:50:53 +0100
Subject: [PATCH] dev #21988 consultation pnb

apply sql patch from emacs
---
 scripts/apply_patch.php     |  5 +++++
 scripts/emacs/phafi-mode.el | 11 +++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 scripts/apply_patch.php

diff --git a/scripts/apply_patch.php b/scripts/apply_patch.php
new file mode 100644
index 00000000000..aae6316b1ec
--- /dev/null
+++ b/scripts/apply_patch.php
@@ -0,0 +1,5 @@
+<?php
+require('console.php');
+require('cosmogramme/sql/patch/patch_'.$argv[1].'.php');
+echo "done\n";
+?>
\ No newline at end of file
diff --git a/scripts/emacs/phafi-mode.el b/scripts/emacs/phafi-mode.el
index 3d0b35b7ff8..6a3b400ca34 100644
--- a/scripts/emacs/phafi-mode.el
+++ b/scripts/emacs/phafi-mode.el
@@ -356,6 +356,17 @@
   )
 
 
+(defun phafi-sql-patch(patch)
+  "Force execution of db migration"
+	(interactive (list (read-number "Enter patch number: ")))
+	
+  (async-shell-command (concat
+												"cd "	(phafi-root-dir) ";"
+												"php scripts/apply_patch.php "(number-to-string patch)
+												))
+  )
+
+
 (defun phafi-root-dir()
   (concat
    (file-name-directory phafi-phpunit-config) "../")
-- 
GitLab