Digital Craftsman
Subscribe
Tagged

postgres

A collection of 2 posts

Add NOT NULL constraint on column in Postgress
postgres

Add NOT NULL constraint on column in Postgress

You can't just add a new non-nullable column to a table when it already has entries in it, as those would be pre filled with NULL. An easy solution is to create it with DEFAULT NULL, update the data and then make it non-nullable. This can look like this: ALTER

  • Christian Kolb
Christian Kolb Mar 1, 2021 • 1 min read
Adapt timezones on Heroku
heroku

Adapt timezones on Heroku

I'm using the dynos of Heroku and the Postgres database addon from Heroku. Both are on UTC by default and Heroku is specifically advising against changing it. So make sure you know the repercussions. Dynos For the dynos you can simple use an environment variable called TZ and set it

  • Christian Kolb
Christian Kolb Sep 14, 2020 • 1 min read
Digital Craftsman © 2021
  • Datenschutz
  • Impressum
Powered by Ghost