|
1 | 1 | # Migration script for Bookmarks |
2 | 2 |
|
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. |
4 | 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: |
| 5 | +## Migrate the bookmarks to project attachments |
13 | 6 |
|
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 | 7 | ```bash |
21 | | -NODE_ENV=development npm run migrate:bookmarks |
| 8 | +npm run migrate:bookmarks |
22 | 9 | ``` |
23 | 10 |
|
24 | | --- Re-check the database usig the SQL statements above |
| 11 | +## Revert: migrate project attachments to the bookmarks |
25 | 12 |
|
26 | | --- Revert the migration using the following command : |
27 | 13 | ```bash |
28 | | -NODE_ENV=development npm run migrate:bookmarks:revert |
| 14 | +npm run migrate:bookmarks:revert |
29 | 15 | ``` |
30 | 16 |
|
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) |
0 commit comments