how to alter thetable to add the not null constraint n postgres code example
Example: postgres add not null to existing column
ALTER TABLE table_name ALTER COLUMN column_name SET NOT NULL;
ALTER TABLE table_name ALTER COLUMN column_name SET NOT NULL;