dsds10
dsds10
Explore posts from servers
DTDrizzle Team
Created by dsds10 on 10/20/2023 in #help
Planetscale db:push has issues with default values
This was very helpful, thank you very much! Now it passes at least. But still gives me these update statements on every run again:
Warning You are about to execute current statements:

ALTER TABLE `follows` MODIFY COLUMN `created_at` timestamp DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `media` MODIFY COLUMN `metadata` json DEFAULT ('{}');
ALTER TABLE `posts` MODIFY COLUMN `published` boolean;
ALTER TABLE `posts` MODIFY COLUMN `published` boolean DEFAULT false;
ALTER TABLE `users` MODIFY COLUMN `is_creator` boolean NOT NULL;
ALTER TABLE `users` MODIFY COLUMN `is_creator` boolean NOT NULL DEFAULT false;
ALTER TABLE `users` MODIFY COLUMN `gender` text NOT NULL DEFAULT ('other');
ALTER TABLE `users` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `users` MODIFY COLUMN `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;

[✓] Changes applied
Warning You are about to execute current statements:

ALTER TABLE `follows` MODIFY COLUMN `created_at` timestamp DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `media` MODIFY COLUMN `metadata` json DEFAULT ('{}');
ALTER TABLE `posts` MODIFY COLUMN `published` boolean;
ALTER TABLE `posts` MODIFY COLUMN `published` boolean DEFAULT false;
ALTER TABLE `users` MODIFY COLUMN `is_creator` boolean NOT NULL;
ALTER TABLE `users` MODIFY COLUMN `is_creator` boolean NOT NULL DEFAULT false;
ALTER TABLE `users` MODIFY COLUMN `gender` text NOT NULL DEFAULT ('other');
ALTER TABLE `users` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `users` MODIFY COLUMN `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;

[✓] Changes applied
Is it caching the metadata or is drizzle just wrongly detecting the urge to change the schema?
4 replies