diff --git a/.gitignore b/.gitignore index e3ed727f..d0769161 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Logs **/.DS_Store -**/prisma/migrations/* +#**/prisma/migrations/* logs *.log diff --git a/bank/bank-backend/prisma/.env b/bank/bank-backend/prisma/.env index b780d05f..71f529fd 100644 --- a/bank/bank-backend/prisma/.env +++ b/bank/bank-backend/prisma/.env @@ -1 +1 @@ -DATABASE_URL="postgresql://bank:postgres@localhost:5432/bank?schema=public" +DATABASE_URL="postgresql://bank:postgres@localhost:5432/bank?schema=public" \ No newline at end of file diff --git a/bank/bank-backend/prisma/migrations/20240606225203_bank_initial/migration.sql b/bank/bank-backend/prisma/migrations/20240606225203_bank_initial/migration.sql new file mode 100644 index 00000000..7c878699 --- /dev/null +++ b/bank/bank-backend/prisma/migrations/20240606225203_bank_initial/migration.sql @@ -0,0 +1,22 @@ +-- CreateTable +CREATE TABLE "AccountInfo" ( + "accountId" BIGSERIAL NOT NULL, + "ownerName" TEXT NOT NULL, + "type" TEXT NOT NULL, + "balance" BIGINT NOT NULL, + + CONSTRAINT "AccountInfo_pkey" PRIMARY KEY ("accountId") +); + +-- CreateTable +CREATE TABLE "TransactionHistory" ( + "txnId" BIGSERIAL NOT NULL, + "fromAccountId" BIGINT NOT NULL, + "fromLocation" TEXT NOT NULL, + "toAccountId" BIGINT NOT NULL, + "toLocation" TEXT NOT NULL, + "amount" INTEGER NOT NULL, + "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "TransactionHistory_pkey" PRIMARY KEY ("txnId") +); diff --git a/bank/bank-backend/prisma/migrations/migration_lock.toml b/bank/bank-backend/prisma/migrations/migration_lock.toml new file mode 100644 index 00000000..fbffa92c --- /dev/null +++ b/bank/bank-backend/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