fix
This commit is contained in:
@@ -8,10 +8,17 @@ module default {
|
||||
))
|
||||
);
|
||||
|
||||
required global currentConversationID: uuid {
|
||||
default := <uuid>"00000000-0000-0000-0000-000000000000"
|
||||
};
|
||||
|
||||
global currentConversation := (
|
||||
assert_single((
|
||||
select Conversation
|
||||
filter .name = 'Default' AND .user = global currentUser
|
||||
select Conversation
|
||||
filter .user = global currentUser AND (
|
||||
.id = global currentConversationID OR
|
||||
(global currentConversationID = <uuid>"00000000-0000-0000-0000-000000000000" AND .name = 'Default')
|
||||
)
|
||||
))
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE MIGRATION m1zlzfafekdlqfpf7zcj4taysmccydrzclqrkxjogkermv4qcn4wia
|
||||
ONTO m1xiilci36z6h4kris43l3gb6w63y7lbql3ismz7coxobr6r2yhz6a
|
||||
{
|
||||
CREATE REQUIRED GLOBAL default::currentConversationID -> std::str {
|
||||
SET default := '';
|
||||
};
|
||||
ALTER GLOBAL default::currentConversation USING (std::assert_single((SELECT
|
||||
default::Conversation
|
||||
FILTER
|
||||
((.user = GLOBAL default::currentUser) AND ((.id = <std::uuid>GLOBAL default::currentConversationID) OR ((GLOBAL default::currentConversationID = '') AND (.name = 'Default'))))
|
||||
)));
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE MIGRATION m1f65xatu7epwthdl6s4yekiuusexvyk2w747gdt5ixzzggxzliyga
|
||||
ONTO m1zlzfafekdlqfpf7zcj4taysmccydrzclqrkxjogkermv4qcn4wia
|
||||
{
|
||||
ALTER GLOBAL default::currentConversationID SET default := '00000000-0000-0000-0000-000000000000';
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
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'))))
|
||||
)));
|
||||
};
|
||||
Reference in New Issue
Block a user