Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 91ef100

Browse files
committed
refactor(drop-topic): remove from table
1 parent 1de1a89 commit 91ef100

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
defmodule GroupherServer.Repo.Migrations.RemoveTopicTables do
2+
use Ecto.Migration
3+
4+
def change do
5+
alter table(:tags) do
6+
remove(:topic_id)
7+
end
8+
9+
drop(unique_index(:pined_posts, [:post_id, :community_id, :topic_id]))
10+
11+
alter table(:pined_posts) do
12+
remove(:topic_id)
13+
end
14+
15+
create(unique_index(:pined_posts, [:post_id, :community_id]))
16+
17+
drop(table(:posts_topics))
18+
drop(table(:topics))
19+
end
20+
end

0 commit comments

Comments
 (0)