Skip to content

Commit edcf5f7

Browse files
committed
Create DB Alias type to reference objects with a custom label/name
1 parent bbec0d4 commit edcf5f7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

dbschema/alias.esdl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module default {
2+
type Alias {
3+
required name: str {
4+
constraint exclusive;
5+
};
6+
required target: Object {
7+
on target delete delete source;
8+
};
9+
}
10+
}

dbschema/migrations/00051.edgeql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE MIGRATION m1tgd6yl63z2bp7ahtbi7sidb5gfl7mjs47ooqfbnuleffpap3auua
2+
ONTO m1vlgekf4eyzweb6xmldmxwzohoh7xbrre6fbc7e2d3t7q7ry3qobq
3+
{
4+
CREATE TYPE default::Alias {
5+
CREATE REQUIRED LINK target: std::Object {
6+
ON TARGET DELETE DELETE SOURCE;
7+
};
8+
CREATE REQUIRED PROPERTY name: std::str {
9+
CREATE CONSTRAINT std::exclusive;
10+
};
11+
};
12+
};

0 commit comments

Comments
 (0)