PHP Classes

File: SQL File

Recommend this page to a friend!
  Packages of Matthew Asham   Binkterm PHP   database/migrations/v1.6.3_fix_draft_timestamps_timezone.sql   Download  
File: database/migrations/v1.6.3_fix_draft_timestamps_timezone.sql
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Binkterm PHP
Bulletin board system based on the Web
Author: By
Last change:
Date: 5 days ago
Size: 736 bytes
 

Contents

Class file image Download
-- Migration: Fix draft timestamps to use timezone-aware storage -- Version: 1.6.3 -- Date: 2025-09-13 -- Convert existing TIMESTAMP columns to TIMESTAMPTZ for timezone awareness -- This ensures consistent UTC storage regardless of server timezone settings -- Drop and recreate with proper timezone handling ALTER TABLE drafts ALTER COLUMN created_at TYPE TIMESTAMPTZ USING created_at AT TIME ZONE 'UTC'; ALTER TABLE drafts ALTER COLUMN updated_at TYPE TIMESTAMPTZ USING updated_at AT TIME ZONE 'UTC'; -- Set default to store in UTC ALTER TABLE drafts ALTER COLUMN created_at SET DEFAULT NOW() AT TIME ZONE 'UTC'; ALTER TABLE drafts ALTER COLUMN updated_at SET DEFAULT NOW() AT TIME ZONE 'UTC'; -- Migration completed successfully