Skip to content

Commit

Permalink
fix : Schema adaptation for Nile tabkes
Browse files Browse the repository at this point in the history
  • Loading branch information
aris-2 committed Dec 2, 2024
1 parent 792fa22 commit 2ee4983
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/better-auth-nile/src/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
},
},
organization: {
modelName: options?.schema?.organization?.modelName,
modelName: options?.schema?.organization?.modelName ?? "tenants",
fields: {
name: {
type: "string",
Expand All @@ -373,7 +373,7 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
createdAt: {
type: "date",
required: true,
fieldName: options?.schema?.organization?.fields?.createdAt,
fieldName: options?.schema?.organization?.fields?.createdAt ?? "created",
},
metadata: {
type: "string",
Expand All @@ -383,7 +383,7 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
},
},
member: {
modelName: options?.schema?.member?.modelName,
modelName: options?.schema?.member?.modelName ?? "tenant_users",
fields: {
organizationId: {
type: "string",
Expand All @@ -392,12 +392,12 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
model: "organization",
field: "id",
},
fieldName: options?.schema?.member?.fields?.organizationId,
fieldName: options?.schema?.member?.fields?.organizationId ?? "tenant_id",
},
userId: {
type: "string",
required: true,
fieldName: options?.schema?.member?.fields?.userId,
fieldName: options?.schema?.member?.fields?.userId ?? "user_id",
references: {
model: "user",
field: "id",
Expand All @@ -412,7 +412,7 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
createdAt: {
type: "date",
required: true,
fieldName: options?.schema?.member?.fields?.createdAt,
fieldName: options?.schema?.member?.fields?.createdAt ?? "created",
},
},
},
Expand All @@ -426,7 +426,7 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
model: "organization",
field: "id",
},
fieldName: options?.schema?.invitation?.fields?.organizationId,
fieldName: options?.schema?.invitation?.fields?.organizationId ?? "tenant_id",
},
email: {
type: "string",
Expand Down

0 comments on commit 2ee4983

Please sign in to comment.