Skip to content

Commit

Permalink
chore!: change database engine from sqlite into postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
ianriizky committed Jul 23, 2024
1 parent 29cf885 commit 38cd4b9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NODE_ENV=development

DB_URL="file:./database.db"
DB_URL=postgresql://root@localhost:5432/push_notification_nextjs_firebase

FIREBASE_ADMIN_TYPE=
FIREBASE_ADMIN_PROJECT_ID=
Expand Down
10 changes: 0 additions & 10 deletions src/database/migrations/20240717031215_1_0_0/migration.sql

This file was deleted.

12 changes: 12 additions & 0 deletions src/database/migrations/20240723032314_1_0_0/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- CreateTable
CREATE TABLE "subscriptions" (
"id" TEXT NOT NULL,
"token" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,

CONSTRAINT "subscriptions_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "subscriptions_token_key" ON "subscriptions"("token");
2 changes: 1 addition & 1 deletion src/database/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"
provider = "postgresql"
2 changes: 1 addition & 1 deletion src/database/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ generator client {
}

datasource db {
provider = "sqlite"
provider = "postgresql"
url = env("DB_URL")
}

Expand Down

0 comments on commit 38cd4b9

Please sign in to comment.