mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Refactoring in roles.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE "projects" DROP CONSTRAINT "projects_organization_id_organization_id_fk";
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "projects" ADD CONSTRAINT "projects_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,13 @@
|
||||
"when": 1756473637441,
|
||||
"tag": "0004_dazzling_hawkeye",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 5,
|
||||
"version": "7",
|
||||
"when": 1762004436821,
|
||||
"tag": "0005_old_swarm",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import {pgTable, text, timestamp, uuid} from "drizzle-orm/pg-core";
|
||||
import {user} from "@/db/schema/02_user";
|
||||
import {User, user} from "@/db/schema/02_user";
|
||||
import {organization} from "@/db/schema/03_organization";
|
||||
import {relations} from "drizzle-orm";
|
||||
import {createSelectSchema} from "drizzle-zod";
|
||||
@@ -32,4 +32,5 @@ export const memberRelations = relations(member, ({ one }) => ({
|
||||
|
||||
|
||||
export const organizationMemberSchema = createSelectSchema(member);
|
||||
export type OrganizationMember = z.infer<typeof organizationMemberSchema>;
|
||||
export type OrganizationMember = z.infer<typeof organizationMemberSchema>;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { pgTable, text, boolean, uuid, timestamp } from "drizzle-orm/pg-core";
|
||||
import { relations } from "drizzle-orm";
|
||||
import { Organization, organization } from "./03_organization";
|
||||
import { createSelectSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
import { Database, database } from "./07_database";
|
||||
import {pgTable, text, boolean, uuid} from "drizzle-orm/pg-core";
|
||||
import {relations} from "drizzle-orm";
|
||||
import {Organization, organization} from "./03_organization";
|
||||
import {createSelectSchema} from "drizzle-zod";
|
||||
import {z} from "zod";
|
||||
import {Database, database} from "./07_database";
|
||||
import {timestamps} from "@/db/schema/00_common";
|
||||
|
||||
export const project = pgTable("projects", {
|
||||
@@ -13,12 +13,11 @@ export const project = pgTable("projects", {
|
||||
isArchived: boolean("is_archived").default(false),
|
||||
organizationId: uuid("organization_id")
|
||||
.notNull()
|
||||
.references(() => organization.id),
|
||||
.references(() => organization.id, {onDelete: "cascade"}),
|
||||
...timestamps
|
||||
|
||||
});
|
||||
|
||||
export const projectRelations = relations(project, ({ one, many }) => ({
|
||||
export const projectRelations = relations(project, ({one, many}) => ({
|
||||
organization: one(organization, {
|
||||
fields: [project.organizationId],
|
||||
references: [organization.id],
|
||||
|
||||
Reference in New Issue
Block a user