Updated database for requests
parent
c97d0ffe55
commit
e1a9287641
@ -1,8 +1,16 @@
|
|||||||
|
DO $$ BEGIN
|
||||||
|
|
||||||
ALTER TABLE IF EXISTS votes
|
ALTER TABLE IF EXISTS votes
|
||||||
ADD COLUMN IF NOT EXISTS vote_type varchar(8) DEFAULT 'UPVOTE',
|
ADD COLUMN IF NOT EXISTS vote_type votetype DEFAULT 'UPVOTE',
|
||||||
|
ALTER COLUMN vote_type TYPE votetype USING cast_to_votetype(vote_type::text),
|
||||||
|
ALTER COLUMN vote_type DROP DEFAULT,
|
||||||
ALTER COLUMN vote_type SET DEFAULT 'UPVOTE';
|
ALTER COLUMN vote_type SET DEFAULT 'UPVOTE';
|
||||||
|
|
||||||
ALTER TABLE IF EXISTS posts
|
ALTER TABLE IF EXISTS posts
|
||||||
|
ALTER COLUMN type TYPE posttype USING cast_to_posttype(type::text),
|
||||||
|
ALTER COLUMN type DROP DEFAULT,
|
||||||
ALTER COLUMN type SET DEFAULT 'MISC',
|
ALTER COLUMN type SET DEFAULT 'MISC',
|
||||||
DROP COLUMN IF EXISTS upvotes,
|
DROP COLUMN IF EXISTS upvotes,
|
||||||
DROP COLUMN IF EXISTS downvotes;
|
DROP COLUMN IF EXISTS downvotes;
|
||||||
|
|
||||||
|
END $$;
|
||||||
|
Loading…
Reference in New Issue