WIP
This commit is contained in:
13
migrations/009_add_document_category.sql
Normal file
13
migrations/009_add_document_category.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- Add category column to admin_documents table
|
||||
-- Allows categorizing documents for training different models (e.g., invoice, letter, receipt)
|
||||
|
||||
ALTER TABLE admin_documents ADD COLUMN IF NOT EXISTS category VARCHAR(100) DEFAULT 'invoice';
|
||||
|
||||
-- Update existing NULL values to default
|
||||
UPDATE admin_documents SET category = 'invoice' WHERE category IS NULL;
|
||||
|
||||
-- Make it NOT NULL after setting defaults
|
||||
ALTER TABLE admin_documents ALTER COLUMN category SET NOT NULL;
|
||||
|
||||
-- Create index for category filtering
|
||||
CREATE INDEX IF NOT EXISTS idx_admin_documents_category ON admin_documents(category);
|
||||
Reference in New Issue
Block a user