feat: subscriptions have personalized notification times (#334)

This commit is contained in:
Miguel Ribeiro
2024-05-20 13:07:40 +02:00
committed by GitHub
parent f1815d7335
commit c7146dfd08
25 changed files with 105 additions and 28 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
/*
This migration adds a column to the subscriptuons table to store individual choice for how many days before the subscription is up for payment to notify the user
The default value of 0 means global settings will be used
*/
/** @noinspection PhpUndefinedVariableInspection */
$columnQuery = $db->query("SELECT * FROM pragma_table_info('subscriptions') where name='notify_days_before'");
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;
if ($columnRequired) {
$db->exec('ALTER TABLE subscriptions ADD COLUMN notify_days_before INTEGER DEFAULT 0');
}
?>