Replace go-migrate with morph (#19116)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c8198fbefe
Коммит
6595b31f23
16
db/migrations/postgres/000042_create_threads.up.sql
Обычный файл
16
db/migrations/postgres/000042_create_threads.up.sql
Обычный файл
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE IF NOT EXISTS threads (
|
||||
postid VARCHAR(26) PRIMARY KEY,
|
||||
replycount bigint,
|
||||
lastreplyat bigint,
|
||||
participants text
|
||||
);
|
||||
|
||||
ALTER TABLE threads ADD COLUMN IF NOT EXISTS channelid VARCHAR(26);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_threads_channel_id ON threads (channelid);
|
||||
|
||||
UPDATE threads
|
||||
SET channelId=posts.channelid
|
||||
FROM posts
|
||||
WHERE posts.id=threads.postid
|
||||
AND threads.channelid IS NULL;
|
||||
Ссылка в новой задаче
Block a user