core/migration/tables/comments.py

30 lines
636 B
Python
Raw Normal View History

2021-08-25 21:20:53 +00:00
from html2text import html2text
2021-08-20 09:27:19 +00:00
import datetime
2021-08-23 08:44:46 +00:00
# markdown = Converter()
2021-08-20 09:27:19 +00:00
def migrate(entry):
2021-08-23 08:44:46 +00:00
'''
2021-09-11 08:20:23 +00:00
type Comment {
id: Int!
2021-08-20 09:27:19 +00:00
author: Int!
body: String!
2021-09-11 08:20:23 +00:00
replyTo: Int!
2021-08-20 09:27:19 +00:00
createdAt: DateTime!
2021-09-11 08:20:23 +00:00
updatedAt: DateTime
shout: Int!
2021-08-20 09:27:19 +00:00
deletedAt: DateTime
deletedBy: Int
rating: Int
2021-09-11 08:20:23 +00:00
ratigns: [Rating]
views: Int
old_id: String
2021-08-20 09:27:19 +00:00
}
2021-08-23 08:44:46 +00:00
'''
2021-08-20 09:27:19 +00:00
# TODO: implement comments migration
return {
'slug': entry['slug'],
'createdAt': entry['createdAt'],
2021-08-23 08:44:46 +00:00
'body': html2text(entry['body']),
2021-08-20 09:27:19 +00:00
'replyTo': entry['']
}