-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
62 additions
and
195 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
migrations/20240430160330_refactor_change_photo_to_nullable/migration.sql
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
migrations/20240502041357_feat_add_admin_model/migration.sql
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
migrations/20240502085152_refactor_remove_admin/migration.sql
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
migrations/20240503213015_feat_add_ip_address_to_attendance/migration.sql
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
migrations/20240503215629_feat_add_visitor_identifier/migration.sql
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
migrations/20240503223334_refactor_change_user_and_attendance_to_non_unique/migration.sql
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
migrations/20240504162426_refactor_remove_created_at_in_date/migration.sql
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
migrations/20240504165032_refactor_change_date_into_day_month_year/migration.sql
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
migrations/20240504175339_refactor_remove_status_in_attendance/migration.sql
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
migrations/20240505135124_del_remove_photo_from_user/migration.sql
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
migrations/20240506184725_fix_delete_cascade/migration.sql
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
migrations/20240511020013_feat_move_to_postgress/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
-- CreateTable | ||
CREATE TABLE "Account" ( | ||
"id" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"email" TEXT NOT NULL, | ||
"password" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Account_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Date" ( | ||
"id" TEXT NOT NULL, | ||
"day" INTEGER NOT NULL, | ||
"month" INTEGER NOT NULL, | ||
"year" INTEGER NOT NULL, | ||
"account_id" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Date_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Attendance" ( | ||
"id" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"user_id" TEXT NOT NULL, | ||
"date_id" TEXT NOT NULL, | ||
"visitor_identifier" TEXT NOT NULL, | ||
"ip_address" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Attendance_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"nim" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"account_id" TEXT NOT NULL, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Account_email_key" ON "Account"("email"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Date" ADD CONSTRAINT "Date_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "Account"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Attendance" ADD CONSTRAINT "Attendance_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Attendance" ADD CONSTRAINT "Attendance_date_id_fkey" FOREIGN KEY ("date_id") REFERENCES "Date"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "User" ADD CONSTRAINT "User_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "Account"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "mysql" | ||
provider = "postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters