Układ procesów
This commit is contained in:
parent
708233f9b4
commit
2630bc9dd8
43
db/migrations/039_update_process_names_and_order.php
Normal file
43
db/migrations/039_update_process_names_and_order.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__ . '/../config.php';
|
||||||
|
|
||||||
|
function migrate_039($pdo) {
|
||||||
|
// 1. Obsługa gościa (guest_handling)
|
||||||
|
// 2. Obsługa przyjęcia nowego członka (obsluga-przyjecia-nowego-czlonka)
|
||||||
|
// 3. Mentoring nowego członka (mentoring)
|
||||||
|
// 4. Szkolenie nowego członka (training_new_member)
|
||||||
|
// 5. Członkostwo (customer_journey)
|
||||||
|
|
||||||
|
$processes = [
|
||||||
|
'guest_handling' => ['name' => 'Obsługa gościa', 'sort_order' => 10],
|
||||||
|
'obsluga-przyjecia-nowego-czlonka' => ['name' => 'Obsługa przyjęcia nowego członka', 'sort_order' => 20],
|
||||||
|
'mentoring' => ['name' => 'Mentoring nowego członka', 'sort_order' => 30],
|
||||||
|
'training_new_member' => ['name' => 'Szkolenie nowego członka', 'sort_order' => 40],
|
||||||
|
'customer_journey' => ['name' => 'Członkostwo', 'sort_order' => 50],
|
||||||
|
|
||||||
|
// Push the other ones to the bottom
|
||||||
|
'meeting_preparation' => ['name' => 'Przygotowanie spotkania grupy', 'sort_order' => 60],
|
||||||
|
'meeting_preparation_meeting' => ['name' => 'Przygotowanie spotkania (spotkanie)', 'sort_order' => 70],
|
||||||
|
];
|
||||||
|
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->prepare("UPDATE process_definitions SET name = :name, sort_order = :sort_order WHERE code = :code");
|
||||||
|
|
||||||
|
foreach ($processes as $code => $data) {
|
||||||
|
$stmt->execute([
|
||||||
|
'name' => $data['name'],
|
||||||
|
'sort_order' => $data['sort_order'],
|
||||||
|
'code' => $code
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Migration 039 successful: Process names and order updated.\n";
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
die("Migration 039 failed: " . $e->getMessage() . "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For manual execution if needed
|
||||||
|
if (basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"])) {
|
||||||
|
migrate_039(db());
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user