mirror of https://github.com/LemmyNet/lemmy
Removing fast tables and old views.
parent
05c3e471ae
commit
4f5e51beb5
@ -1 +1,4 @@
|
|||||||
docker exec -it dev_lemmy_db_1 pg_dumpall -c -U rrr > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
|
#!/bin/bash
|
||||||
|
pushd dev
|
||||||
|
docker-compose exec postgres pg_dumpall -c -U lemmy > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
|
||||||
|
popd
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
drop view user_alias_1, user_alias_2, comment_alias_1;
|
@ -0,0 +1,7 @@
|
|||||||
|
-- Some view that act as aliases
|
||||||
|
-- unfortunately necessary, since diesel doesn't have self joins
|
||||||
|
-- or alias support yet
|
||||||
|
create view user_alias_1 as select * from user_;
|
||||||
|
create view user_alias_2 as select * from user_;
|
||||||
|
create view comment_alias_1 as select * from comment;
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
-- There is no restore for this, it would require every view, table, index, etc.
|
||||||
|
-- If you want to save past this point, you should make a DB backup.
|
||||||
|
|
||||||
|
select * from user_ limit 1;
|
@ -0,0 +1,41 @@
|
|||||||
|
-- Drop views
|
||||||
|
drop view if exists
|
||||||
|
comment_aggregates_view,
|
||||||
|
comment_fast_view,
|
||||||
|
comment_report_view,
|
||||||
|
comment_view,
|
||||||
|
community_aggregates_view,
|
||||||
|
community_fast_view,
|
||||||
|
community_follower_view,
|
||||||
|
community_moderator_view,
|
||||||
|
community_user_ban_view,
|
||||||
|
community_view,
|
||||||
|
mod_add_community_view,
|
||||||
|
mod_add_view,
|
||||||
|
mod_ban_from_community_view,
|
||||||
|
mod_ban_view,
|
||||||
|
mod_lock_post_view,
|
||||||
|
mod_remove_comment_view,
|
||||||
|
mod_remove_community_view,
|
||||||
|
mod_remove_post_view,
|
||||||
|
mod_sticky_post_view,
|
||||||
|
post_aggregates_view,
|
||||||
|
post_fast_view,
|
||||||
|
post_report_view,
|
||||||
|
post_view,
|
||||||
|
private_message_view,
|
||||||
|
reply_fast_view,
|
||||||
|
site_view,
|
||||||
|
user_mention_fast_view,
|
||||||
|
user_mention_view,
|
||||||
|
user_view
|
||||||
|
cascade;
|
||||||
|
|
||||||
|
-- Drop fast tables
|
||||||
|
drop table if exists
|
||||||
|
comment_aggregates_fast,
|
||||||
|
community_aggregates_fast,
|
||||||
|
post_aggregates_fast,
|
||||||
|
user_fast
|
||||||
|
cascade;
|
||||||
|
|
Loading…
Reference in New Issue