Skip to content

Commit b2147b9

Browse files
committed
docs: improve bookmarks migration script docs
1 parent ae3766b commit b2147b9

File tree

3 files changed

+43
-25
lines changed

3 files changed

+43
-25
lines changed

config/development.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"enableFileUpload": "false",
32
"pubsubQueueName": "dev.project.service",
43
"pubsubExchangeName": "dev.projects",
54
"attachmentsS3Bucket": "topcoder-dev-media",

migrations/bookmarks/README.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,19 @@
11
# Migration script for Bookmarks
22

3-
To check the bookmarks migration, follow the instructions below:
3+
To run any of these commands, make sure that `NODE_ENV` environment variable is set to `production` or `development` depend on which environment you would like to run migration for.
44

5-
```bash
6-
-- sync the database (This will drop and re-create the tables)
7-
NODE_ENV=development npm run sync:db
8-
-- Insert the test data
9-
NODE_ENV=development npx babel-node migrations/bookmarks/insertTestData.js
10-
```
11-
12-
-- Check the database tables projects and project_attachments using the following SQL statements:
5+
## Migrate the bookmarks to project attachments
136

14-
```sql
15-
select id, name, bookmarks from projects order by id;
16-
select * from project_attachments;
17-
```
18-
19-
-- Migrate the bookmarks to project attachments
207
```bash
21-
NODE_ENV=development npm run migrate:bookmarks
8+
npm run migrate:bookmarks
229
```
2310

24-
-- Re-check the database usig the SQL statements above
11+
## Revert: migrate project attachments to the bookmarks
2512

26-
-- Revert the migration using the following command :
2713
```bash
28-
NODE_ENV=development npm run migrate:bookmarks:revert
14+
npm run migrate:bookmarks:revert
2915
```
3016

31-
-- Re-check the database using the following SQL statements:
32-
```sql
33-
select id, name, bookmarks from projects order by id;
34-
select id, pa.type, pa."deletedAt" from project_attachments pa
35-
```
17+
## References
18+
19+
- [Verification guide for "Migration script for Bookmarks"](Verification.md)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Verification guide for "Migration script for Bookmarks"
2+
3+
To check the bookmarks migration, follow the instructions below:
4+
5+
```bash
6+
-- sync the database (This will drop and re-create the tables)
7+
NODE_ENV=development npm run sync:db
8+
-- Insert the test data
9+
NODE_ENV=development npx babel-node migrations/bookmarks/insertTestData.js
10+
```
11+
12+
-- Check the database tables projects and project_attachments using the following SQL statements:
13+
14+
```sql
15+
select id, name, bookmarks from projects order by id;
16+
select * from project_attachments;
17+
```
18+
19+
-- Migrate the bookmarks to project attachments
20+
```bash
21+
NODE_ENV=development npm run migrate:bookmarks
22+
```
23+
24+
-- Re-check the database usig the SQL statements above
25+
26+
-- Revert the migration using the following command :
27+
```bash
28+
NODE_ENV=development npm run migrate:bookmarks:revert
29+
```
30+
31+
-- Re-check the database using the following SQL statements:
32+
```sql
33+
select id, name, bookmarks from projects order by id;
34+
select id, pa.type, pa."deletedAt" from project_attachments pa
35+
```

0 commit comments

Comments
 (0)