mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-26 19:21:43 +00:00
[SIS-xxx] making quote attachment URL column larger
changing migration script for starboard/quotes
This commit is contained in:
@@ -14,13 +14,17 @@ engine = db.create_engine('postgresql://%s:%s@%s:%s/%s' % (db_user, db_password,
|
||||
|
||||
with engine.connect() as con:
|
||||
posts = load_all_starboard_posts(con)
|
||||
print(posts)
|
||||
print(f'Loaded {len(posts)}')
|
||||
enriched_posts = enrich_posts(posts)
|
||||
print(f'Enriched posts')
|
||||
import_quotes(enriched_posts, con)
|
||||
print(f'Done storing quotes')
|
||||
con.commit()
|
||||
fix_quote_created(enriched_posts, con)
|
||||
con.commit()
|
||||
print('Done.')
|
||||
sub_posts = chunks = [posts[x:x+100] for x in range(0, len(posts), 100)]
|
||||
print(f'Loaded {len(posts)} into {len(sub_posts)} partitions')
|
||||
counter = 0
|
||||
for sub_post in sub_posts:
|
||||
print(f'Partition size {len(sub_post)}')
|
||||
enriched_posts = enrich_posts(sub_post)
|
||||
print(f'Enriched posts')
|
||||
import_quotes(enriched_posts, con)
|
||||
print(f'Done storing quotes')
|
||||
con.commit()
|
||||
fix_quote_created(enriched_posts, con)
|
||||
con.commit()
|
||||
counter += 1
|
||||
print(f'Done. {counter}')
|
||||
Reference in New Issue
Block a user