Skip to content

Commit

Permalink
remove db constrans
Browse files Browse the repository at this point in the history
  • Loading branch information
bastipnt committed Dec 13, 2024
1 parent 1464631 commit 5c257cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
8 changes: 2 additions & 6 deletions packages/backend/dbschema/default.esdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ module default {
}

type SurveyPart1 {
required user: User {
constraint exclusive;
};
required user: User;
required createdAt: datetime;
required numLastWeeksAds1: str {
constraint one_of ("none", "once", "sometimes", "often");
Expand All @@ -41,9 +39,7 @@ module default {
}

type SurveyPart2 {
required user: User {
constraint exclusive;
};
required user: User;
required createdAt: datetime;
required interestInLearning8: str {
constraint one_of ("yes", "kinda", "no");
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/dbschema/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export namespace $default {
"createdAt": Date;
}
export interface SurveyPart1 extends std.$Object {
"user": User;
"IAmTrackedKnowledge4": string;
"howDoAdvertisersKnow2": string;
"knowledgeHowTracking6": string;
Expand All @@ -89,15 +88,16 @@ export namespace $default {
"okToBeTracked5": string;
"trackingMethodsFamiliar7": string[];
"createdAt": Date;
"user": User;
}
export interface SurveyPart2 extends std.$Object {
"user": User;
"age10": string;
"interestInLearning8": string;
"learningApproaches9": string[];
"work11": string;
"createdAt": Date;
"pronouns12": string;
"user": User;
}
export interface User extends std.$Object {
"visitorId": string;
Expand Down
14 changes: 14 additions & 0 deletions packages/backend/dbschema/migrations/00004-m1e5umr.edgeql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE MIGRATION m1e5umr4hdzkvsnj7gpfkits4lzo5mkof6gr4js3s4eursnits25fa
ONTO m1qj5uuugfgjfpqhscmqchzvunmqksqq4tpbe37wh3rxyis2fzin4a
{
ALTER TYPE default::SurveyPart1 {
ALTER LINK user {
DROP CONSTRAINT std::exclusive;
};
};
ALTER TYPE default::SurveyPart2 {
ALTER LINK user {
DROP CONSTRAINT std::exclusive;
};
};
};

0 comments on commit 5c257cd

Please sign in to comment.