From d24b47490bfd78d90208f2c769ba14730d05d654 Mon Sep 17 00:00:00 2001 From: Tyler Aldrich Date: Tue, 8 Aug 2023 16:09:01 -0400 Subject: [PATCH 01/42] add migrations --- .../20230808200805_first_migration/migration.sql | 11 +++++++++++ prisma/migrations/migration_lock.toml | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 prisma/migrations/20230808200805_first_migration/migration.sql create mode 100644 prisma/migrations/migration_lock.toml diff --git a/prisma/migrations/20230808200805_first_migration/migration.sql b/prisma/migrations/20230808200805_first_migration/migration.sql new file mode 100644 index 0000000..31ea15f --- /dev/null +++ b/prisma/migrations/20230808200805_first_migration/migration.sql @@ -0,0 +1,11 @@ +-- CreateTable +CREATE TABLE "Yeet" ( + "id" TEXT NOT NULL, + "createdAt" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deletedAt" TIMESTAMP(6), + "ownerId" TEXT NOT NULL, + "message" VARCHAR(280) NOT NULL, + + CONSTRAINT "Yeet_pkey" PRIMARY KEY ("id") +); diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..fbffa92 --- /dev/null +++ b/prisma/migrations/migration_lock.toml @@ -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" \ No newline at end of file From 20eee9caab2155373eeea1c2063593c27745f565 Mon Sep 17 00:00:00 2001 From: Tyler Aldrich Date: Tue, 8 Aug 2023 18:30:18 -0400 Subject: [PATCH 02/42] Update twitter clone to include db migration, fix a couple bugs preventing remote deployments from working --- app/(home)/home-yeet-form.tsx | 4 ++-- app/_components/button.tsx | 3 ++- architect.yml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/(home)/home-yeet-form.tsx b/app/(home)/home-yeet-form.tsx index 5dfd44f..4303d24 100644 --- a/app/(home)/home-yeet-form.tsx +++ b/app/(home)/home-yeet-form.tsx @@ -21,9 +21,9 @@ export const HomeYeetForm = () => { body: JSON.stringify({ message, }), + }).then(() => { + location.reload(); }); - - location.reload(); }; return session ? ( diff --git a/app/_components/button.tsx b/app/_components/button.tsx index ea0efb2..3804871 100644 --- a/app/_components/button.tsx +++ b/app/_components/button.tsx @@ -42,5 +42,6 @@ export const Button = (props: ButtonProps) => { } const btn =