Update New Features
This commit is contained in:
17
migrations/fix_storage_usage.sql
Normal file
17
migrations/fix_storage_usage.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Fix storage_usage table initialization
|
||||
-- This script safely initializes storage_usage if empty
|
||||
|
||||
-- Delete any incomplete records first
|
||||
DELETE FROM storage_usage WHERE id IS NULL;
|
||||
|
||||
-- Insert with explicit UUID generation if table is empty
|
||||
INSERT INTO storage_usage (id, total_bytes_used, max_bytes_allowed, last_updated)
|
||||
SELECT
|
||||
gen_random_uuid(),
|
||||
0,
|
||||
10737418240, -- 10GB default
|
||||
CURRENT_TIMESTAMP
|
||||
WHERE NOT EXISTS (SELECT 1 FROM storage_usage);
|
||||
|
||||
-- Verify the record was created
|
||||
SELECT * FROM storage_usage;
|
||||
Reference in New Issue
Block a user