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