This commit is contained in:
13
db_init.php
13
db_init.php
@ -13,7 +13,7 @@ if (defined('QDB_TEST_UPLOADS')) {
|
||||
define('QDB_LOCK', QDB_UPLOADS_DIR . '/.qdb_lock');
|
||||
}
|
||||
define('QDB_SCHEMA', __DIR__ . '/schema.sql');
|
||||
define('QDB_VERSION', 10);
|
||||
define('QDB_VERSION', 11);
|
||||
|
||||
function qdb_table_exists(PDO $pdo, string $table): bool {
|
||||
$stmt = $pdo->prepare(
|
||||
@ -44,6 +44,17 @@ function qdb_apply_migrations(PDO $pdo, string $schemaSql): bool {
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
if (qdb_table_exists($pdo, 'client')) {
|
||||
if (!qdb_column_exists($pdo, 'client', 'archived')) {
|
||||
$pdo->exec('ALTER TABLE client ADD COLUMN archived INTEGER NOT NULL DEFAULT 0');
|
||||
$changed = true;
|
||||
}
|
||||
if (!qdb_column_exists($pdo, 'client', 'archivedAt')) {
|
||||
$pdo->exec('ALTER TABLE client ADD COLUMN archivedAt INTEGER NOT NULL DEFAULT 0');
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!qdb_table_exists($pdo, 'questionnaire_submission')) {
|
||||
$pdo->exec("
|
||||
CREATE TABLE questionnaire_submission (
|
||||
|
||||
Reference in New Issue
Block a user