diff options
Diffstat (limited to 'drizzle/20260115140000_push_tokens_array/migration.sql')
| -rw-r--r-- | drizzle/20260115140000_push_tokens_array/migration.sql | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drizzle/20260115140000_push_tokens_array/migration.sql b/drizzle/20260115140000_push_tokens_array/migration.sql new file mode 100644 index 0000000..9adc51a --- /dev/null +++ b/drizzle/20260115140000_push_tokens_array/migration.sql @@ -0,0 +1,9 @@ +-- Convert push_token from text to text[] array +-- First, create the new column +ALTER TABLE "users" ADD COLUMN "push_tokens" text[] DEFAULT '{}';--> statement-breakpoint + +-- Migrate existing single token to array format (skip null values) +UPDATE "users" SET "push_tokens" = ARRAY[push_token]::text[] WHERE push_token IS NOT NULL;--> statement-breakpoint + +-- Drop the old column +ALTER TABLE "users" DROP COLUMN "push_token"; |