Added migration for Availability and related
This commit is contained in:
		
							parent
							
								
									8c589b9dc1
								
							
						
					
					
						commit
						ee603a0a27
					
				
					 1 changed files with 31 additions and 0 deletions
				
			
		|  | @ -0,0 +1,31 @@ | |||
| /* | ||||
|   Warnings: | ||||
| 
 | ||||
|   - You are about to drop the `ResetPasswordRequest` table. If the table is not empty, all the data it contains will be lost. | ||||
| 
 | ||||
| */ | ||||
| -- AlterTable | ||||
| ALTER TABLE "EventType" ADD COLUMN     "timeZone" TEXT; | ||||
| 
 | ||||
| -- DropTable | ||||
| DROP TABLE "ResetPasswordRequest"; | ||||
| 
 | ||||
| -- CreateTable | ||||
| CREATE TABLE "Availability" ( | ||||
|     "id" SERIAL NOT NULL, | ||||
|     "label" TEXT, | ||||
|     "userId" INTEGER, | ||||
|     "eventTypeId" INTEGER, | ||||
|     "days" INTEGER[], | ||||
|     "startTime" INTEGER NOT NULL, | ||||
|     "endTime" INTEGER NOT NULL, | ||||
|     "date" DATE, | ||||
| 
 | ||||
|     PRIMARY KEY ("id") | ||||
| ); | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE "Availability" ADD FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE "Availability" ADD FOREIGN KEY ("eventTypeId") REFERENCES "EventType"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||||
		Loading…
	
		Reference in a new issue
	
	 Alex van Andel
						Alex van Andel