Update db schema
This commit is contained in:
parent
f2f6547b22
commit
381262b121
@ -8,17 +8,10 @@ module default {
|
|||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
required global currentConversationID: uuid {
|
global currentConversation := (
|
||||||
default := <uuid>"00000000-0000-0000-0000-000000000000"
|
|
||||||
};
|
|
||||||
|
|
||||||
global currentConversation := (
|
|
||||||
assert_single((
|
assert_single((
|
||||||
select Conversation
|
select Conversation
|
||||||
filter .user = global currentUser AND (
|
filter .user = global currentUser AND .selected = true
|
||||||
.id = global currentConversationID OR
|
|
||||||
(global currentConversationID = <uuid>"00000000-0000-0000-0000-000000000000" AND .name = 'Default')
|
|
||||||
)
|
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -52,6 +45,9 @@ module default {
|
|||||||
type Conversation {
|
type Conversation {
|
||||||
required name: str;
|
required name: str;
|
||||||
required position: int32;
|
required position: int32;
|
||||||
|
required selected: bool {
|
||||||
|
default := false;
|
||||||
|
};
|
||||||
required user: User {
|
required user: User {
|
||||||
on target delete delete source;
|
on target delete delete source;
|
||||||
};
|
};
|
||||||
|
9
dbschema/migrations/00048-m1xxfsh.edgeql
Normal file
9
dbschema/migrations/00048-m1xxfsh.edgeql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
CREATE MIGRATION m1xxfshhhqeharx244nyz5gs27xxrsp6bhb2f7smizwj6pf3bsqwtq
|
||||||
|
ONTO m1nb4byflyh4jp3yp6zdr6ydzw7btucfslsznwz7ooywnmbjxqyl6q
|
||||||
|
{
|
||||||
|
ALTER TYPE default::Conversation {
|
||||||
|
CREATE REQUIRED PROPERTY seleted: std::bool {
|
||||||
|
SET default := false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
6
dbschema/migrations/00049-m1rtddn.edgeql
Normal file
6
dbschema/migrations/00049-m1rtddn.edgeql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
CREATE MIGRATION m1rtddnmmb2imreqjy622lkxgmzrtau77xggdw477im46cgn53njza
|
||||||
|
ONTO m1xxfshhhqeharx244nyz5gs27xxrsp6bhb2f7smizwj6pf3bsqwtq
|
||||||
|
{
|
||||||
|
DROP GLOBAL default::currentConversation;
|
||||||
|
DROP GLOBAL default::currentConversationID;
|
||||||
|
};
|
14
dbschema/migrations/00050-m1kkf4h.edgeql
Normal file
14
dbschema/migrations/00050-m1kkf4h.edgeql
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
CREATE MIGRATION m1kkf4hwv2zxvzjxckc4semtent43nd4ed4bn5462ph2ffpocpo24a
|
||||||
|
ONTO m1rtddnmmb2imreqjy622lkxgmzrtau77xggdw477im46cgn53njza
|
||||||
|
{
|
||||||
|
ALTER TYPE default::Conversation {
|
||||||
|
ALTER PROPERTY seleted {
|
||||||
|
RENAME TO selected;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
CREATE GLOBAL default::currentConversation := (std::assert_single((SELECT
|
||||||
|
default::Conversation
|
||||||
|
FILTER
|
||||||
|
((.user = GLOBAL default::currentUser) AND (.selected = true))
|
||||||
|
)));
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user