Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit c84f8e9

Browse files
committed
add migration for missing value
1 parent 70a6fe6 commit c84f8e9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# frozen_string_literal: true
2+
class MoveDallEUrl < ActiveRecord::Migration[7.2]
3+
def up
4+
execute <<~SQL
5+
UPDATE site_settings
6+
SET name = 'ai_openai_image_generation_url'
7+
WHERE name = 'ai_openai_dall_e_3_url'
8+
AND NOT EXISTS (
9+
SELECT 1
10+
FROM site_settings
11+
WHERE name = 'ai_openai_image_generation_url')
12+
SQL
13+
14+
execute <<~SQL
15+
DELETE FROM site_settings
16+
WHERE name = 'ai_openai_dall_e_3_url'
17+
SQL
18+
end
19+
20+
def down
21+
raise ActiveRecord::IrreversibleMigration
22+
end
23+
end

0 commit comments

Comments
 (0)