first commit
This commit is contained in:
commit
c9fb67e751
423 files changed
+53287
No files matched your search
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `anexos` table. If the table is not empty, all the data it contains will be lost.
|
||||
- You are about to drop the `anexos_atendimento` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "anexos" DROP CONSTRAINT "anexos_tarefaId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "anexos_atendimento" DROP CONSTRAINT "anexos_atendimento_atendimentoId_fkey";
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "anexos";
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "anexos_atendimento";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Anexo" (
|
||||
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
|
||||
"nome" TEXT NOT NULL,
|
||||
"url" TEXT NOT NULL,
|
||||
"tipo" TEXT NOT NULL,
|
||||
"tamanho" INTEGER NOT NULL,
|
||||
"atendimentoId" UUID,
|
||||
"tarefaId" UUID,
|
||||
"criadoEm" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "Anexo_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Anexo_atendimentoId_idx" ON "Anexo"("atendimentoId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Anexo_tarefaId_idx" ON "Anexo"("tarefaId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Anexo" ADD CONSTRAINT "Anexo_atendimentoId_fkey" FOREIGN KEY ("atendimentoId") REFERENCES "atendimentos"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Anexo" ADD CONSTRAINT "Anexo_tarefaId_fkey" FOREIGN KEY ("tarefaId") REFERENCES "tarefas"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
Reference in new issue
Block a user