excel preview & file handling
This commit is contained in:
3
src/db/migrations/0005_add_is_generated_timesheets.sql
Normal file
3
src/db/migrations/0005_add_is_generated_timesheets.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Add flag to mark system-generated timesheets
|
||||
ALTER TABLE timesheets
|
||||
ADD COLUMN IF NOT EXISTS is_generated BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
@@ -89,6 +89,17 @@ BEGIN
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- Add is_generated flag to timesheets if not exists
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name='timesheets' AND column_name='is_generated'
|
||||
) THEN
|
||||
ALTER TABLE timesheets ADD COLUMN is_generated BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- Create indexes for better query performance
|
||||
CREATE INDEX IF NOT EXISTS idx_companies_created_at ON companies(created_at);
|
||||
CREATE INDEX IF NOT EXISTS idx_projects_company_id ON projects(company_id);
|
||||
|
||||
Reference in New Issue
Block a user