Skip to content

Commit

Permalink
drizzle relation and studio fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Usama Tariq committed Dec 20, 2024
1 parent 98bc521 commit 8fe7c15
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 23 deletions.
17 changes: 17 additions & 0 deletions src/db/migrations/0013_closed_toro.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_messages` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`chat_id` integer NOT NULL,
`type` text NOT NULL,
`sender_id` integer NOT NULL,
`message` text NOT NULL,
`timestamp` integer NOT NULL,
`updated_at` text,
`created_at` text DEFAULT CURRENT_TIMESTAMP,
`deleted_at` text
);
--> statement-breakpoint
INSERT INTO `__new_messages`("id", "chat_id", "type", "sender_id", "message", "timestamp", "updated_at", "created_at", "deleted_at") SELECT "id", "chat_id", "type", "sender_id", "message", "timestamp", "updated_at", "created_at", "deleted_at" FROM `messages`;--> statement-breakpoint
DROP TABLE `messages`;--> statement-breakpoint
ALTER TABLE `__new_messages` RENAME TO `messages`;--> statement-breakpoint
PRAGMA foreign_keys=ON;
Loading

0 comments on commit 8fe7c15

Please sign in to comment.