Skip to content
Snippets Groups Projects
Commit b44b6b5e authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Columns added via alter table should have also defined DEFAULT constrains to...

Columns added via alter table should have also defined DEFAULT constrains to satisfy INSERT statements.
parent 16094486
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!367issue #89: net_votes and total_votes are calculated during sync
......@@ -204,8 +204,10 @@ IF NOT EXISTS (SELECT data_type FROM information_schema.columns
UPDATE hive_posts SET total_votes = 0, net_votes = 0; -- Artificial number, requires to start update_posts_rshares for all blocks
ALTER TABLE ONLY hive_posts
ALTER COLUMN total_votes set not null,
ALTER COLUMN net_votes set not null;
ALTER COLUMN total_votes SET NOT NULL,
ALTER COLUMN total_votes SET DEFAULT 0,
ALTER COLUMN net_votes SET NOT NULL,
ALTER COLUMN net_votes SET DEFAULT 0;
PERFORM deps_restore_dependencies('public', 'hive_posts');
ELSE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment