mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-25 12:22:58 +03:00
f48dab4a7d
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
23 lines
506 B
SQL
23 lines
506 B
SQL
DO $$
|
|
BEGIN
|
|
IF EXISTS (
|
|
SELECT 1
|
|
FROM information_schema.columns
|
|
WHERE table_name = 'brains' AND column_name = 'openai_api_key'
|
|
) THEN
|
|
-- Column exists, so drop it
|
|
ALTER TABLE brains
|
|
DROP COLUMN openai_api_key;
|
|
END IF;
|
|
END $$;
|
|
|
|
|
|
-- Update migrations table
|
|
INSERT INTO migrations (name)
|
|
SELECT '20231128173900_remove_openai_api_key'
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM migrations WHERE name = '20231128173900_remove_openai_api_key'
|
|
);
|
|
|
|
COMMIT;
|