formatted
This commit is contained in:
parent
90c552a8f3
commit
06c8d9c66b
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
Tech stack:
|
Tech stack:
|
||||||
|
|
||||||
- pyjwt
|
- pyjwt
|
||||||
- redis
|
- redis
|
||||||
- ariadne
|
- ariadne
|
||||||
- starlette
|
- starlette
|
||||||
|
|
||||||
# Local development
|
# Local development
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
## Based on
|
## Based on
|
||||||
|
|
||||||
* pyjwt
|
- pyjwt
|
||||||
* [ariadne](https://github.com/mirumee/ariadne)
|
- [ariadne](https://github.com/mirumee/ariadne)
|
||||||
* [aioredis](https://github.com/aio-libs/aioredis)
|
- [aioredis](https://github.com/aio-libs/aioredis)
|
||||||
* [starlette](https://github.com/encode/starlette)、
|
- [starlette](https://github.com/encode/starlette)、
|
||||||
* sqlalchmy ORM
|
- sqlalchmy ORM
|
||||||
|
|
||||||
token is valid for one day, user can choose to logout, logout is revoke token
|
token is valid for one day, user can choose to logout, logout is revoke token
|
||||||
|
|
|
@ -10,8 +10,8 @@ pipenv install -r requirements.txt
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
Put the unpacked mongodump to the `data` folder and operate with `pipenv shell && python`
|
Put the unpacked mongodump to the `data` folder and operate with
|
||||||
|
`pipenv shell && python`
|
||||||
|
|
||||||
1. get old data jsons
|
1. get old data jsons
|
||||||
|
|
||||||
|
@ -23,19 +23,16 @@ bson2json.json_tables() # creates all the needed data json from bson mongodump
|
||||||
|
|
||||||
2. migrate users
|
2. migrate users
|
||||||
|
|
||||||
```py
|
```sh
|
||||||
import json
|
pipenv run python migrate.py users
|
||||||
from migrations.users import migrate
|
|
||||||
|
|
||||||
data = json.loads(open('data/users.json').read())
|
|
||||||
newdata = {}
|
|
||||||
|
|
||||||
for u in data:
|
|
||||||
try:
|
|
||||||
newdata[u['_id']] = migrate(u)
|
|
||||||
except:
|
|
||||||
print('FAIL!')
|
|
||||||
print(u)
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Note: this will create db entries and it is not tolerant to existed unique email.
|
||||||
|
|
||||||
|
3. then topics and shouts
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pipenv run python migrate.py topics
|
||||||
|
pipenv run python migrate.py shouts
|
||||||
|
```
|
||||||
|
|
||||||
|
Now you got the *.dict.json files which contain all the data with old and new(!) ids.
|
|
@ -215,7 +215,6 @@ type Topic {
|
||||||
|
|
||||||
# TODO: resolvers to add/remove topics from publication
|
# TODO: resolvers to add/remove topics from publication
|
||||||
|
|
||||||
|
|
||||||
type Proposal {
|
type Proposal {
|
||||||
body: String!
|
body: String!
|
||||||
shout: Int!
|
shout: Int!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user