add mentions
This commit is contained in:
@@ -132,6 +132,15 @@ SCHEMA = [
|
||||
"user_id" REFERENCES users(id) ON DELETE CASCADE
|
||||
)""",
|
||||
|
||||
"""CREATE TABLE IF NOT EXISTS "mentions" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY,
|
||||
"revision_id" REFERENCES post_history(id) ON DELETE CASCADE,
|
||||
"mentioned_user_id" REFERENCES users(id) ON DELETE CASCADE,
|
||||
"start_index" INTEGER NOT NULL,
|
||||
"end_index" INTEGER NOT NULL,
|
||||
"original_mention_text" TEXT NOT NULL
|
||||
)""",
|
||||
|
||||
# INDEXES
|
||||
"CREATE INDEX IF NOT EXISTS idx_post_history_post_id ON post_history(post_id)",
|
||||
"CREATE INDEX IF NOT EXISTS idx_posts_thread ON posts(thread_id, created_at, id)",
|
||||
@@ -155,6 +164,9 @@ SCHEMA = [
|
||||
|
||||
"CREATE INDEX IF NOT EXISTS idx_bookmarked_threads_collection ON bookmarked_threads(collection_id)",
|
||||
"CREATE INDEX IF NOT EXISTS idx_bookmarked_threads_thread ON bookmarked_threads(thread_id)",
|
||||
|
||||
"CREATE INDEX IF NOT EXISTS idx_mentioned_user ON mentions(mentioned_user_id)",
|
||||
"CREATE INDEX IF NOT EXISTS idx_mention_revision_id ON mentions(revision_id)",
|
||||
]
|
||||
|
||||
def create():
|
||||
|
||||
Reference in New Issue
Block a user