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): def migrate(entry):
''' '''
# is comment type Comment {
type Shout { id: Int!
org: String!
slug: String
author: Int! author: Int!
body: String! body: String!
replyTo: Int!
createdAt: DateTime! createdAt: DateTime!
updatedAt: DateTime! updatedAt: DateTime
shout: Int!
deletedAt: DateTime deletedAt: DateTime
deletedBy: Int deletedBy: Int
rating: Int rating: Int
published: DateTime # if there is no published field - it is not published ratigns: [Rating]
replyTo: String # another shout views: Int
tags: [String] # actual values old_id: String
topics: [String] # topic-slugs
title: String
versionOf: String
visibleForRoles: [String] # role ids are strings
visibleForUsers: [Int]
} }
''' '''
# TODO: implement comments migration # TODO: implement comments migration
return { return {
'org_id': 0,
'slug': entry['slug'], 'slug': entry['slug'],
'createdAt': entry['createdAt'], 'createdAt': entry['createdAt'],
'body': html2text(entry['body']), 'body': html2text(entry['body']),

View File

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

View File

@ -41,7 +41,7 @@ def migrate(entry, limit=668):
res['emailConfirmed'] = entry['emails'][0]['verified'] res['emailConfirmed'] = entry['emails'][0]['verified']
res['createdAt'] = parse(entry['createdAt']) res['createdAt'] = parse(entry['createdAt'])
res['rating'] = entry['rating'] # number 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['ratings'] = [] # entry['ratings']
res['notifications'] = [] res['notifications'] = []
res['links'] = [] res['links'] = []

View File

@ -189,7 +189,7 @@ type Comment {
body: String! body: String!
replyTo: Int! replyTo: Int!
createdAt: DateTime! createdAt: DateTime!
updatedAt: DateTime! updatedAt: DateTime
shout: Int! shout: Int!
deletedAt: DateTime deletedAt: DateTime
deletedBy: Int deletedBy: Int
@ -223,7 +223,7 @@ type Shout {
updatedAt: DateTime updatedAt: DateTime
updatedBy: Int # can be user id? updatedBy: Int # can be user id?
deletedAt: DateTime deletedAt: DateTime
deletedBy: Int deletedBy: Int
publishedBy: Int # if there is no published field - it is not published publishedBy: Int # if there is no published field - it is not published
publishedAt: DateTime publishedAt: DateTime
old_id: String old_id: String