mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-30 20:14:01 +01:00
Request body is now an object
This commit is contained in:
1 parent
ef23a85577
commit
758154fa14
16 files changed
+73
-54
No files matched your search
@@ -0,0 +1,16 @@
|
||||
-- Rename old column to backup name
|
||||
ALTER TABLE http_requests
|
||||
RENAME COLUMN body TO body_old;
|
||||
|
||||
-- Create desired new body column
|
||||
ALTER TABLE http_requests
|
||||
ADD COLUMN body TEXT NOT NULL DEFAULT '{}';
|
||||
|
||||
-- Copy data from old to new body, in new JSON format
|
||||
UPDATE http_requests
|
||||
SET body = CASE WHEN body_old IS NULL THEN '{}' ELSE JSON_OBJECT('text', body_old) END
|
||||
WHERE TRUE;
|
||||
|
||||
-- Drop old column
|
||||
ALTER TABLE http_requests
|
||||
DROP COLUMN body_old;
|
||||
Reference in new issue
Block a user