refactoring and more work with clerk
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `event_failed` table. If the table is not empty, all the data it contains will be lost.
|
||||
- You are about to drop the `recent_dashboards` table. If the table is not empty, all the data it contains will be lost.
|
||||
- Added the required column `organization_slug` to the `dashboards` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "recent_dashboards" DROP CONSTRAINT "recent_dashboards_dashboard_id_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "recent_dashboards" DROP CONSTRAINT "recent_dashboards_project_id_fkey";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "dashboards" ADD COLUMN "organization_slug" TEXT NOT NULL;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "event_failed";
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "recent_dashboards";
|
||||
@@ -19,11 +19,10 @@ model Project {
|
||||
profiles Profile[]
|
||||
clients Client[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
reports Report[]
|
||||
dashboards Dashboard[]
|
||||
RecentDashboards RecentDashboards[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
reports Report[]
|
||||
dashboards Dashboard[]
|
||||
|
||||
@@map("projects")
|
||||
}
|
||||
@@ -67,15 +66,6 @@ model Profile {
|
||||
@@map("profiles")
|
||||
}
|
||||
|
||||
model EventFailed {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
data Json
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
|
||||
@@map("event_failed")
|
||||
}
|
||||
|
||||
model Client {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
||||
name String
|
||||
@@ -91,19 +81,6 @@ model Client {
|
||||
@@map("clients")
|
||||
}
|
||||
|
||||
model RecentDashboards {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()"))
|
||||
project_id String
|
||||
project Project @relation(fields: [project_id], references: [id])
|
||||
organization_slug String
|
||||
dashboard_id String
|
||||
dashboard Dashboard @relation(fields: [dashboard_id], references: [id])
|
||||
user_id String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@map("recent_dashboards")
|
||||
}
|
||||
|
||||
enum Interval {
|
||||
hour
|
||||
day
|
||||
@@ -121,15 +98,15 @@ enum ChartType {
|
||||
}
|
||||
|
||||
model Dashboard {
|
||||
id String @id @default(dbgenerated("gen_random_uuid()"))
|
||||
name String
|
||||
project_id String
|
||||
project Project @relation(fields: [project_id], references: [id])
|
||||
reports Report[]
|
||||
id String @id @default(dbgenerated("gen_random_uuid()"))
|
||||
name String
|
||||
organization_slug String
|
||||
project_id String
|
||||
project Project @relation(fields: [project_id], references: [id])
|
||||
reports Report[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
RecentDashboards RecentDashboards[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
|
||||
@@map("dashboards")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user