-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: complete participant registration
- Loading branch information
Showing
13 changed files
with
511 additions
and
82 deletions.
There are no files selected for viewing
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
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,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"); |
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,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": {} | ||
} | ||
} |
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
Oops, something went wrong.