add import messages/calls ui feedback
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "ProcessingPhoneNumber" (
|
||||
"createdAt" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"hasFetchedMessages" BOOLEAN NOT NULL,
|
||||
"hasFetchedCalls" BOOLEAN NOT NULL,
|
||||
"phoneNumberId" TEXT NOT NULL,
|
||||
"organizationId" TEXT NOT NULL,
|
||||
|
||||
PRIMARY KEY ("organizationId","phoneNumberId")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ProcessingPhoneNumber_phoneNumberId_unique" ON "ProcessingPhoneNumber"("phoneNumberId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ProcessingPhoneNumber" ADD FOREIGN KEY ("phoneNumberId") REFERENCES "PhoneNumber"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ProcessingPhoneNumber" ADD FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
@ -31,6 +31,7 @@ model Organization {
|
||||
notificationSubscriptions NotificationSubscription[]
|
||||
messages Message[]
|
||||
phoneCalls PhoneCall[]
|
||||
processingPhoneNumbers ProcessingPhoneNumber[]
|
||||
|
||||
@@unique([id, twilioAccountSid])
|
||||
}
|
||||
@ -194,12 +195,25 @@ model PhoneNumber {
|
||||
phoneCalls PhoneCall[]
|
||||
notificationSubscriptions NotificationSubscription[]
|
||||
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
organizationId String
|
||||
processingPhoneNumber ProcessingPhoneNumber?
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
organizationId String
|
||||
|
||||
@@unique([organizationId, id])
|
||||
}
|
||||
|
||||
model ProcessingPhoneNumber {
|
||||
createdAt DateTime @default(now()) @db.Timestamptz
|
||||
hasFetchedMessages Boolean
|
||||
hasFetchedCalls Boolean
|
||||
phoneNumber PhoneNumber @relation(fields: [phoneNumberId], references: [id])
|
||||
phoneNumberId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
organizationId String
|
||||
|
||||
@@id([organizationId, phoneNumberId])
|
||||
}
|
||||
|
||||
model NotificationSubscription {
|
||||
id String @id @default(uuid())
|
||||
createdAt DateTime @default(now()) @db.Timestamptz
|
||||
|
Reference in New Issue
Block a user