role_id and topic relations fixes
This commit is contained in:
36
migration/tables/comments.py
Normal file
36
migration/tables/comments.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from html2md import Converter
|
||||
import datetime
|
||||
|
||||
markdown = Converter()
|
||||
|
||||
def migrate(entry):
|
||||
```
|
||||
# is comment
|
||||
type Shout {
|
||||
org: String!
|
||||
slug: String!
|
||||
author: Int!
|
||||
body: String!
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
deletedAt: DateTime
|
||||
deletedBy: Int
|
||||
rating: Int
|
||||
published: DateTime # if there is no published field - it is not published
|
||||
replyTo: String # another shout
|
||||
tags: [String] # actual values
|
||||
topics: [String] # topic-slugs
|
||||
title: String
|
||||
versionOf: String
|
||||
visibleForRoles: [String] # role ids are strings
|
||||
visibleForUsers: [Int]
|
||||
}
|
||||
```
|
||||
# TODO: implement comments migration
|
||||
return {
|
||||
'org': 'discours.io',
|
||||
'slug': entry['slug'],
|
||||
'createdAt': entry['createdAt'],
|
||||
'body': markdown(entry['body']),
|
||||
'replyTo': entry['']
|
||||
}
|
Reference in New Issue
Block a user