© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
3 replies
dsds10

Planetscale db:push has issues with default values

 Warning  You are about to execute current statements:

ALTER TABLE `comments` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `comments` MODIFY COLUMN `updated_at` timestamp DEFAULT (now());
ALTER TABLE `follows` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `media` MODIFY COLUMN `metadata` json DEFAULT ('{}');
ALTER TABLE `media` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `media` MODIFY COLUMN `updated_at` timestamp DEFAULT (now());
ALTER TABLE `post_actions` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `posts` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());
ALTER TABLE `posts` MODIFY COLUMN `updated_at` timestamp NOT NULL DEFAULT (now());
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 DEFAULT (now());
ALTER TABLE `users` MODIFY COLUMN `updated_at` timestamp DEFAULT (now());
 Warning  You are about to execute current statements:

ALTER TABLE `comments` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `comments` MODIFY COLUMN `updated_at` timestamp DEFAULT (now());
ALTER TABLE `follows` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `media` MODIFY COLUMN `metadata` json DEFAULT ('{}');
ALTER TABLE `media` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `media` MODIFY COLUMN `updated_at` timestamp DEFAULT (now());
ALTER TABLE `post_actions` MODIFY COLUMN `created_at` timestamp DEFAULT (now());
ALTER TABLE `posts` MODIFY COLUMN `created_at` timestamp NOT NULL DEFAULT (now());
ALTER TABLE `posts` MODIFY COLUMN `updated_at` timestamp NOT NULL DEFAULT (now());
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 DEFAULT (now());
ALTER TABLE `users` MODIFY COLUMN `updated_at` timestamp DEFAULT (now());


Just tried to update my database, was prototyping it for some time, and thought I should sync it again (actually to add a property). Now I can see that there are a lot of default sets (unnecessary, as they are like so in the db), and especially the ones for "timestamp" are not working. Repeatidly getting error for an invalid default value:

target: hush.-.primary: vttablet: rpc error: code = InvalidArgument desc = Invalid default value for 'created_at' (errno 1067) (sqlstate 42000) (CallerID: y4tgjk3s3x4hy562qtn7): Sql: "alter table posts modify column updated_at timestamp not null default (now())", BindVars: {REDACTED}
target: hush.-.primary: vttablet: rpc error: code = InvalidArgument desc = Invalid default value for 'created_at' (errno 1067) (sqlstate 42000) (CallerID: y4tgjk3s3x4hy562qtn7): Sql: "alter table posts modify column updated_at timestamp not null default (now())", BindVars: {REDACTED}


Even if I manually modify the database hoping drizzle-kit would then forget these updates, it doesn't work. Running all on drizzle's latest versions.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

db push when adding notNull column with default() value
Drizzle TeamDTDrizzle Team / help
3y ago
Failed push to planetscale
Drizzle TeamDTDrizzle Team / help
2y ago
Error querying planetscale db
Drizzle TeamDTDrizzle Team / help
3y ago
db push error
Drizzle TeamDTDrizzle Team / help
2y ago