diff --git a/migration/tables/comments.py b/migration/tables/comments.py index a5f63ac6..c8f504a6 100644 --- a/migration/tables/comments.py +++ b/migration/tables/comments.py @@ -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']), diff --git a/migration/tables/content_items.py b/migration/tables/content_items.py index 25c73165..a3980af8 100644 --- a/migration/tables/content_items.py +++ b/migration/tables/content_items.py @@ -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': [], diff --git a/migration/tables/users.py b/migration/tables/users.py index 56b608d3..ffb918c6 100644 --- a/migration/tables/users.py +++ b/migration/tables/users.py @@ -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'] = [] diff --git a/schema.graphql b/schema.graphql index 20ebd23e..f7445f06 100644 --- a/schema.graphql +++ b/schema.graphql @@ -189,7 +189,7 @@ type Comment { body: String! replyTo: Int! createdAt: DateTime! - updatedAt: DateTime! + updatedAt: DateTime shout: Int! deletedAt: DateTime deletedBy: Int @@ -223,7 +223,7 @@ type Shout { updatedAt: DateTime updatedBy: Int # can be user id? deletedAt: DateTime - deletedBy: Int + deletedBy: Int publishedBy: Int # if there is no published field - it is not published publishedAt: DateTime old_id: String