aboutsummaryrefslogtreecommitdiffhomepage
path: root/migrations
diff options
context:
space:
mode:
authorwinter2025-01-19 23:49:31 +0000
committerwinter2025-01-19 23:49:31 +0000
commit55433eeca50ff840cb0b660f8f9de44b2bc6825f (patch)
treee4ddec94902bb46966ac0f658617147b25743cec /migrations
parentbf031d9a72a34922f3ac8ccdf5212a384103fc80 (diff)
allow old sessions to get cleaned up
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20250119_233507_add_session_created.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/migrations/20250119_233507_add_session_created.php b/migrations/20250119_233507_add_session_created.php
new file mode 100644
index 0000000..c4978cb
--- /dev/null
+++ b/migrations/20250119_233507_add_session_created.php
@@ -0,0 +1,8 @@
+<?php
+
+use \Digitigrade\Db\Migrator;
+
+Migrator::getInstance()->register(20250119_233507, function (PDO $db) {
+ // track when sessions were created so they can be tidied up after some time
+ $db->exec('ALTER TABLE session ADD COLUMN created timestamp with time zone not null default current_timestamp');
+});