discourse/db/migrate/20150727230537_add_example_column_comments.rb
Kane York 13d56eb989 FEATURE: Add CommentMigration for db column comments
For documenting the database (will be used in discourse-data-explorer)
2015-07-28 13:14:07 -07:00

27 lines
1.0 KiB
Ruby

require 'comment_migration'
class AddExampleColumnComments < CommentMigration
def comments_up
{
posts: {
_table: 'If you want to query public posts only, use the badge_posts view.',
post_number: 'The position of this post in the topic. The pair (topic_id, post_number) forms a natural key on the posts table.',
raw: 'The raw Markdown that the user entered into the composer.',
cooked: 'The processed HTML that is presented in a topic.',
reply_to_post_number: "If this post is a reply to another, this column is the post_number of the post it's replying to. [FKEY posts.topic_id, posts.post_number]",
reply_quoted: 'This column is true if the post contains a quote-reply, which causes the in-reply-to indicator to be absent.',
},
topics: {
_table: "To query public topics only: SELECT ... FROM topics t LEFT INNER JOIN categories c ON (t.category_id = c.id AND c.read_restricted = false)"
},
}
end
def comments_down
{
}
end
end