Dustin
Dustin
BABetter Auth
Created by Dustin on 4/25/2025 in #help
Extending the Organization plugin
I would love to add this feature to the already existing plugin, maybe with a config flag like teams. I am not sure if this is needed, though
7 replies
BABetter Auth
Created by Dustin on 4/25/2025 in #help
Extending the Organization plugin
I just tested teams and I dont think you can join multiple teams in an org.
7 replies
BABetter Auth
Created by Dustin on 4/25/2025 in #help
Extending the Organization plugin
I am not sure if the "teams" feature already does that. Am I able to join multiple teams?
7 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
create table "group" ("id" text not null primary key, "organizationId" text not null references "organization" ("id"), "name" text not null); create table "group_member" ("id" text not null primary key, "groupId" text not null references "group" ("id"), "memberId" text not null references "member" ("id"));
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
yea, no on delete cascade
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
I see, one sec
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
How do I create a migration file
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
There are no migration files. Better-auth just migrates 😄
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
No description
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
No description
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
I think the adapter, or something, is not creating the foreign keys correctly...
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
Using Kysely Postgres, I am creating the migration with pnpx @better-auth/cli migrate --config ./server/utils/auth.ts, version is: 1.2.5, updating now
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
No description
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
It should delete the group on deleting the org, there are no member in the group or org. I am getting the same error. I cannot delete an org, when there is a group existing in it.
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
group: { fields: { organizationId: { type: "string", required: true, references: { model: "organization", field: "id", onDelete: "cascade", }, }, name: { type: "string", required: true, }, }, }, This is the group schema, pretty simple, only org ID and name
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
Ok other example
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
What do you mean?
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
This table links members (of orgs) to groups (my plugin). If I delete a group, every row with groupId should be deleted, since this group can no longer have members. If I delete a member (remove a user from an org), all rows with memberId of this member should be deleted, since you can't be a member of a group of an org you are not a member of.
27 replies
BABetter Auth
Created by Dustin on 4/18/2025 in #help
plugin schema: onDelete: "cascade" does not work?
memberId is linked to the member table of the organization plugin. The schema you are seeing is the group_member table.
27 replies