feat: convert to nextjs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "consumer" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"letters" TEXT NOT NULL,
|
||||
"year" INTEGER NOT NULL,
|
||||
"zipCode" TEXT NOT NULL,
|
||||
"persona" JSONB NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "consumer_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "purchases" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"value" JSONB NOT NULL,
|
||||
"consumerId" INTEGER NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "purchases_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "purchases" ADD CONSTRAINT "purchases_consumerId_fkey" FOREIGN KEY ("consumerId") REFERENCES "consumer"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `persona` on the `consumer` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `year` on the `consumer` table. All the data in the column will be lost.
|
||||
- Added the required column `birthday` to the `consumer` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "consumer" DROP COLUMN "persona",
|
||||
DROP COLUMN "year",
|
||||
ADD COLUMN "birthday" TIMESTAMP(3) NOT NULL,
|
||||
ADD COLUMN "editedValue" JSONB,
|
||||
ADD COLUMN "value" JSONB;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "purchases" ALTER COLUMN "value" DROP NOT NULL;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "consumer" ALTER COLUMN "letters" DROP NOT NULL,
|
||||
ALTER COLUMN "zipCode" DROP NOT NULL,
|
||||
ALTER COLUMN "birthday" DROP NOT NULL;
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (i.e. Git)
|
||||
provider = "postgresql"
|
||||
Reference in New Issue
Block a user