migration-usable
This commit is contained in:
@@ -6,14 +6,14 @@ import sys
|
||||
import os
|
||||
|
||||
# from export import export_email_subscriptions
|
||||
from export import export_mdx, export_slug
|
||||
from .export import export_mdx, export_slug
|
||||
from orm.reaction import Reaction
|
||||
from tables.users import migrate as migrateUser
|
||||
from tables.users import migrate_2stage as migrateUser_2stage
|
||||
from tables.content_items import get_shout_slug, migrate as migrateShout
|
||||
from tables.topics import migrate as migrateTopic
|
||||
from tables.comments import migrate as migrateComment
|
||||
from tables.comments import migrate_2stage as migrateComment_2stage
|
||||
from .tables.users import migrate as migrateUser
|
||||
from .tables.users import migrate_2stage as migrateUser_2stage
|
||||
from .tables.content_items import get_shout_slug, migrate as migrateShout
|
||||
from .tables.topics import migrate as migrateTopic
|
||||
from .tables.comments import migrate as migrateComment
|
||||
from .tables.comments import migrate_2stage as migrateComment_2stage
|
||||
|
||||
from settings import DB_URL
|
||||
|
||||
@@ -301,5 +301,4 @@ def migrate():
|
||||
print('[migration] usage: python migrate.py <command>')
|
||||
print('[migration] commands: mongodb, bson, all, all mdx, - <slug>')
|
||||
|
||||
if __name__ == '__main__':
|
||||
migrate()
|
||||
migrate()
|
@@ -2,7 +2,7 @@ import os
|
||||
import bson
|
||||
import json
|
||||
|
||||
from utils import DateTimeEncoder
|
||||
from .utils import DateTimeEncoder
|
||||
|
||||
def json_tables():
|
||||
print('[migration] unpack dump/discours/*.bson to migration/data/*.json')
|
||||
|
@@ -3,8 +3,8 @@ from datetime import datetime
|
||||
import json
|
||||
import os
|
||||
import frontmatter
|
||||
from extract import extract_html, prepare_html_body
|
||||
from utils import DateTimeEncoder
|
||||
from .extract import extract_html, prepare_html_body
|
||||
from .utils import DateTimeEncoder
|
||||
|
||||
OLD_DATE = '2016-03-05 22:22:00.350000'
|
||||
EXPORT_DEST = '../discoursio-web/data/'
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import re
|
||||
import base64
|
||||
from html2text import html2text
|
||||
from .html2text import html2text
|
||||
|
||||
TOOLTIP_REGEX = r'(\/\/\/(.+)\/\/\/)'
|
||||
contentDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'discoursio-web', 'content')
|
||||
|
@@ -3,7 +3,7 @@ from dateutil.parser import parse as date_parse
|
||||
from orm import Reaction, User
|
||||
from orm import reaction
|
||||
from base.orm import local_session
|
||||
from html2text import html2text
|
||||
from migration.html2text import html2text
|
||||
from orm.reaction import ReactionKind
|
||||
from orm.shout import Shout
|
||||
|
||||
|
@@ -5,7 +5,7 @@ from services.stat.viewed import ViewedByDay
|
||||
from transliterate import translit
|
||||
from datetime import datetime
|
||||
from base.orm import local_session
|
||||
from extract import prepare_html_body
|
||||
from migration.extract import prepare_html_body
|
||||
from orm.community import Community
|
||||
from orm.reaction import Reaction, ReactionKind
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
from extract import extract_md, html2text
|
||||
from migration.extract import extract_md, html2text
|
||||
from base.orm import local_session
|
||||
from orm import Topic, Community
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import sqlalchemy
|
||||
from html2text import html2text
|
||||
from migration.html2text import html2text
|
||||
from orm import User, UserRating
|
||||
from dateutil.parser import parse
|
||||
from base.orm import local_session
|
||||
|
Reference in New Issue
Block a user