Jade/dbschema/migrations/00047-m1nb4by.edgeql
2024-05-28 10:52:28 +02:00

15 lines
720 B
Plaintext

CREATE MIGRATION m1nb4byflyh4jp3yp6zdr6ydzw7btucfslsznwz7ooywnmbjxqyl6q
ONTO m1f65xatu7epwthdl6s4yekiuusexvyk2w747gdt5ixzzggxzliyga
{
DROP GLOBAL default::currentConversation;
DROP GLOBAL default::currentConversationID;
CREATE REQUIRED GLOBAL default::currentConversationID -> std::uuid {
SET default := (<std::uuid>'00000000-0000-0000-0000-000000000000');
};
CREATE GLOBAL default::currentConversation := (std::assert_single((SELECT
default::Conversation
FILTER
((.user = GLOBAL default::currentUser) AND ((.id = GLOBAL default::currentConversationID) OR ((GLOBAL default::currentConversationID = <std::uuid>'00000000-0000-0000-0000-000000000000') AND (.name = 'Default'))))
)));
};