using comment entity

This commit is contained in:
Untone 2021-09-11 11:20:23 +03:00
parent c18836ef80
commit 9515a35e7a
4 changed files with 11 additions and 19 deletions

View File

@ -5,30 +5,24 @@ import datetime
def migrate(entry):
'''
# is comment
type Shout {
org: String!
slug: String
type Comment {
id: Int!
author: Int!
body: String!
replyTo: Int!
createdAt: DateTime!
updatedAt: DateTime!
updatedAt: DateTime
shout: Int!
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]
ratigns: [Rating]
views: Int
old_id: String
}
'''
# TODO: implement comments migration
return {
'org_id': 0,
'slug': entry['slug'],
'createdAt': entry['createdAt'],
'body': html2text(entry['body']),

View File

@ -32,7 +32,6 @@ type2layout = {
def migrate(entry, limit=3626, start=0):
'''
type Shout {
org_id: Int!
slug: String!
author: Int!
body: String!
@ -55,7 +54,6 @@ def migrate(entry, limit=3626, start=0):
}
'''
r = {
'org_id': 0,
'layout': type2layout[entry['type']],
'title': entry['title'],
'authors': [],

View File

@ -41,7 +41,7 @@ def migrate(entry, limit=668):
res['emailConfirmed'] = entry['emails'][0]['verified']
res['createdAt'] = parse(entry['createdAt'])
res['rating'] = entry['rating'] # number
res['roles'] = [] # entry['roles'] # roles without org is for discours.io
res['roles'] = [] # entry['roles'] # roles by community
res['ratings'] = [] # entry['ratings']
res['notifications'] = []
res['links'] = []

View File

@ -189,7 +189,7 @@ type Comment {
body: String!
replyTo: Int!
createdAt: DateTime!
updatedAt: DateTime!
updatedAt: DateTime
shout: Int!
deletedAt: DateTime
deletedBy: Int