Initial hop. implementation and UGREEN NAS deployment guide
This commit is contained in:
17
apps/server/drizzle/0005_tan_miracleman.sql
Normal file
17
apps/server/drizzle/0005_tan_miracleman.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
||||
CREATE TABLE `__new_deletion_operations` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`userId` text,
|
||||
`guestId` text,
|
||||
`undoUntil` integer NOT NULL,
|
||||
`createdAt` integer NOT NULL,
|
||||
`restoredAt` integer,
|
||||
FOREIGN KEY (`userId`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action,
|
||||
FOREIGN KEY (`guestId`) REFERENCES `guest_sessions`(`id`) ON UPDATE no action ON DELETE no action,
|
||||
CONSTRAINT "deletion_subject" CHECK(("__new_deletion_operations"."guestId" IS NOT NULL) + ("__new_deletion_operations"."userId" IS NOT NULL) = 1)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
INSERT INTO `__new_deletion_operations`("id", "userId", "guestId", "undoUntil", "createdAt", "restoredAt") SELECT "id", "userId", "guestId", "undoUntil", "createdAt", "restoredAt" FROM `deletion_operations`;--> statement-breakpoint
|
||||
DROP TABLE `deletion_operations`;--> statement-breakpoint
|
||||
ALTER TABLE `__new_deletion_operations` RENAME TO `deletion_operations`;--> statement-breakpoint
|
||||
PRAGMA foreign_keys=ON;
|
||||
Reference in New Issue
Block a user