Skip to content

Commit

Permalink
feat: complete participant registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphico committed Jun 24, 2024
1 parent 409f1bf commit 3045548
Show file tree
Hide file tree
Showing 13 changed files with 511 additions and 82 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The architecture of this project revolves around a streamlined development and d
- [x] Edit workshop
- [ ] Interactive workshop session(e.g video conferencing, live chat code editor)
- [x] Delete workshop
- [ ] Participant registration
- [x] Participant registration
- [ ] Join workshops with workshop code
- [ ] Complete workshop & dashboard page

Expand Down
11 changes: 11 additions & 0 deletions drizzle/migrations/0007_exotic_shriek.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE "registrations" RENAME COLUMN "participant_id" TO "registrant_id";--> statement-breakpoint
ALTER TABLE "registrations" DROP CONSTRAINT "registrations_participant_id_unique";--> statement-breakpoint
ALTER TABLE "registrations" DROP CONSTRAINT "registrations_participant_id_users_id_fk";
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "registrations" ADD CONSTRAINT "registrations_registrant_id_users_id_fk" FOREIGN KEY ("registrant_id") REFERENCES "users"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "registrations" ADD CONSTRAINT "registrations_registrant_id_unique" UNIQUE("registrant_id");
298 changes: 298 additions & 0 deletions drizzle/migrations/meta/0007_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
{
"id": "8ffad2dd-f372-4e8d-8e86-57e1473cf678",
"prevId": "4dfe737c-9e8c-4902-aaa0-a9f825346b2d",
"version": "5",
"dialect": "pg",
"tables": {
"registrations": {
"name": "registrations",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": true,
"notNull": true
},
"workshop_id": {
"name": "workshop_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true
},
"registrant_id": {
"name": "registrant_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true
},
"registered_at": {
"name": "registered_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"registrations_workshop_id_workshops_id_fk": {
"name": "registrations_workshop_id_workshops_id_fk",
"tableFrom": "registrations",
"tableTo": "workshops",
"columnsFrom": [
"workshop_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"registrations_registrant_id_users_id_fk": {
"name": "registrations_registrant_id_users_id_fk",
"tableFrom": "registrations",
"tableTo": "users",
"columnsFrom": [
"registrant_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"registrations_workshop_id_unique": {
"name": "registrations_workshop_id_unique",
"nullsNotDistinct": false,
"columns": [
"workshop_id"
]
},
"registrations_registrant_id_unique": {
"name": "registrations_registrant_id_unique",
"nullsNotDistinct": false,
"columns": [
"registrant_id"
]
}
}
},
"sessions": {
"name": "sessions",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"sessions_user_id_users_id_fk": {
"name": "sessions_user_id_users_id_fk",
"tableFrom": "sessions",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"users": {
"name": "users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(50)",
"primaryKey": false,
"notNull": true
},
"github_id": {
"name": "github_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "varchar(50)",
"primaryKey": false,
"notNull": true
},
"image": {
"name": "image",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "current_timestamp"
}
},
"indexes": {
"user_github_idx": {
"name": "user_github_idx",
"columns": [
"github_id"
],
"isUnique": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"users_github_id_unique": {
"name": "users_github_id_unique",
"nullsNotDistinct": false,
"columns": [
"github_id"
]
}
}
},
"workshops": {
"name": "workshops",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": true,
"notNull": true
},
"organizer_id": {
"name": "organizer_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "varchar(50)",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"date": {
"name": "date",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"duration": {
"name": "duration",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"is_public": {
"name": "is_public",
"type": "boolean",
"primaryKey": false,
"notNull": true
},
"access_code": {
"name": "access_code",
"type": "varchar(8)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false,
"default": "current_timestamp"
}
},
"indexes": {},
"foreignKeys": {
"workshops_organizer_id_users_id_fk": {
"name": "workshops_organizer_id_users_id_fk",
"tableFrom": "workshops",
"tableTo": "users",
"columnsFrom": [
"organizer_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"workshops_access_code_unique": {
"name": "workshops_access_code_unique",
"nullsNotDistinct": false,
"columns": [
"access_code"
]
}
}
}
},
"enums": {},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
"when": 1718393969645,
"tag": "0006_deep_xorn",
"breakpoints": true
},
{
"idx": 7,
"version": "5",
"when": 1718820349734,
"tag": "0007_exotic_shriek",
"breakpoints": true
}
]
}
Loading

0 comments on commit 3045548

Please sign in to comment.