mirror of
https://github.com/ellite/Wallos.git
synced 2025-12-23 23:18:07 -05:00
12 lines
514 B
PHP
12 lines
514 B
PHP
<?php
|
|
// This migration adds an "enabled" column to the payment_methods table and sets all values to 1.
|
|
// It allows the user to disable payment methods without deleting them.
|
|
|
|
$columnQuery = $db->query("SELECT * FROM pragma_table_info('payment_methods') where name='enabled'");
|
|
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;
|
|
|
|
if ($columnRequired) {
|
|
$db->exec('ALTER TABLE payment_methods ADD COLUMN enabled BOOLEAN DEFAULT 1');
|
|
$db->exec('UPDATE payment_methods SET enabled = 1');
|
|
}
|