Skip to content

Commit 62949da

Browse files
authored
Merge pull request #4 from stevenfrog/migrate-dynamo-data
migrate dynamo data
2 parents 5d77a1e + 68cb0c7 commit 62949da

File tree

8 files changed

+2333
-5
lines changed

8 files changed

+2333
-5
lines changed

docs/Member API.postman_collection.json

Lines changed: 176 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info": {
3-
"_postman_id": "6b1e570c-0cc5-4836-a38e-f1031dd7e14e",
3+
"_postman_id": "f145acb8-7605-4f62-8b70-e54daccc574f",
44
"name": "Member API",
55
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
66
"_exporter_id": "23458"
@@ -1502,6 +1502,181 @@
15021502
"response": []
15031503
}
15041504
]
1505+
},
1506+
{
1507+
"name": "Migrate Verify",
1508+
"item": [
1509+
{
1510+
"name": "Search Member",
1511+
"request": {
1512+
"auth": {
1513+
"type": "noauth"
1514+
},
1515+
"method": "GET",
1516+
"header": [],
1517+
"url": {
1518+
"raw": "http://localhost:3000/v6/members?perPage=20&page=1",
1519+
"protocol": "http",
1520+
"host": [
1521+
"localhost"
1522+
],
1523+
"port": "3000",
1524+
"path": [
1525+
"v6",
1526+
"members"
1527+
],
1528+
"query": [
1529+
{
1530+
"key": "handle",
1531+
"value": "phead",
1532+
"disabled": true
1533+
},
1534+
{
1535+
"key": "perPage",
1536+
"value": "20"
1537+
},
1538+
{
1539+
"key": "page",
1540+
"value": "1"
1541+
}
1542+
]
1543+
}
1544+
},
1545+
"response": []
1546+
},
1547+
{
1548+
"name": "Get Member",
1549+
"request": {
1550+
"auth": {
1551+
"type": "noauth"
1552+
},
1553+
"method": "GET",
1554+
"header": [],
1555+
"url": {
1556+
"raw": "http://localhost:3000/v6/members/phead",
1557+
"protocol": "http",
1558+
"host": [
1559+
"localhost"
1560+
],
1561+
"port": "3000",
1562+
"path": [
1563+
"v6",
1564+
"members",
1565+
"phead"
1566+
]
1567+
}
1568+
},
1569+
"response": []
1570+
},
1571+
{
1572+
"name": "Get Member Traits",
1573+
"request": {
1574+
"auth": {
1575+
"type": "bearer",
1576+
"bearer": [
1577+
{
1578+
"key": "token",
1579+
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTk4MDk5Mjc4OCwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU0OTc5MTYxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.q_Db9Gw8bn54xlythrZZUrJQyak-XrdOwPsj6ddgZ4M",
1580+
"type": "string"
1581+
}
1582+
]
1583+
},
1584+
"method": "GET",
1585+
"header": [],
1586+
"url": {
1587+
"raw": "http://localhost:3000/v6/members/phead/traits",
1588+
"protocol": "http",
1589+
"host": [
1590+
"localhost"
1591+
],
1592+
"port": "3000",
1593+
"path": [
1594+
"v6",
1595+
"members",
1596+
"phead",
1597+
"traits"
1598+
]
1599+
}
1600+
},
1601+
"response": []
1602+
},
1603+
{
1604+
"name": "Get Stats",
1605+
"request": {
1606+
"auth": {
1607+
"type": "noauth"
1608+
},
1609+
"method": "GET",
1610+
"header": [],
1611+
"url": {
1612+
"raw": "http://localhost:3000/v6/members/phead/stats",
1613+
"protocol": "http",
1614+
"host": [
1615+
"localhost"
1616+
],
1617+
"port": "3000",
1618+
"path": [
1619+
"v6",
1620+
"members",
1621+
"phead",
1622+
"stats"
1623+
]
1624+
}
1625+
},
1626+
"response": []
1627+
},
1628+
{
1629+
"name": "Get History Stats",
1630+
"request": {
1631+
"auth": {
1632+
"type": "noauth"
1633+
},
1634+
"method": "GET",
1635+
"header": [],
1636+
"url": {
1637+
"raw": "http://localhost:3000/v6/members/phead/stats/history",
1638+
"protocol": "http",
1639+
"host": [
1640+
"localhost"
1641+
],
1642+
"port": "3000",
1643+
"path": [
1644+
"v6",
1645+
"members",
1646+
"phead",
1647+
"stats",
1648+
"history"
1649+
]
1650+
}
1651+
},
1652+
"response": []
1653+
},
1654+
{
1655+
"name": "Get Skills",
1656+
"request": {
1657+
"auth": {
1658+
"type": "noauth"
1659+
},
1660+
"method": "GET",
1661+
"header": [],
1662+
"url": {
1663+
"raw": "http://localhost:3000/v6/members/phead/skills",
1664+
"protocol": "http",
1665+
"host": [
1666+
"localhost"
1667+
],
1668+
"port": "3000",
1669+
"path": [
1670+
"v6",
1671+
"members",
1672+
"phead",
1673+
"skills"
1674+
]
1675+
}
1676+
},
1677+
"response": []
1678+
}
1679+
]
15051680
}
15061681
]
15071682
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"seed-data": "node src/scripts/seed-data.js",
1414
"reset-db": "prisma migrate reset",
1515
"test": "mocha -t 20000 test/unit/*.test.js --exit",
16-
"test:cov": "nyc --reporter=html --reporter=text npm test"
16+
"test:cov": "nyc --reporter=html --reporter=text npm test",
17+
"migrate-dynamo-data": "node src/scripts/migrate-dynamo-data.js"
1718
},
1819
"author": "TCSCODER",
1920
"license": "none",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- AlterEnum
2+
ALTER TYPE "DeviceType" ADD VALUE 'Other';
3+
4+
-- AlterTable
5+
ALTER TABLE "member" ADD COLUMN "country" TEXT;
6+
7+
-- AlterTable
8+
ALTER TABLE "memberTraitDevice" ADD COLUMN "osLanguage" TEXT,
9+
ADD COLUMN "osVersion" TEXT;
10+
11+
-- AlterTable
12+
ALTER TABLE "memberTraitOnboardChecklist" ADD COLUMN "skip" BOOLEAN;

prisma/schema.prisma

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ model member {
4343
newEmailVerifyToken String?
4444
newEmailVerifyTokenDate DateTime?
4545
addresses memberAddress[]
46+
47+
country String?
4648
homeCountryCode String?
4749
competitionCountryCode String?
4850
photoURL String?
@@ -585,6 +587,7 @@ enum DeviceType {
585587
Smartphone
586588
Tablet
587589
Wearable
590+
Other
588591
}
589592

590593
model memberTraitDevice {
@@ -596,6 +599,8 @@ model memberTraitDevice {
596599
manufacturer String
597600
model String
598601
operatingSystem String
602+
osVersion String?
603+
osLanguage String?
599604
600605
memberTraits memberTraits @relation(fields: [memberTraitId], references: [id], onDelete: Cascade)
601606
@@ -768,6 +773,7 @@ model memberTraitOnboardChecklist {
768773
date DateTime
769774
message String
770775
status String
776+
skip Boolean?
771777
metadata Json?
772778
773779
memberTraits memberTraits @relation(fields: [memberTraitId], references: [id], onDelete: Cascade)

src/scripts/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
module.exports = {
33
apiUrl: 'https://api.topcoder-dev.com/v5/members',
44
fileLocation: '../member_data',
5+
migrateLocation: '../migrate-data',
56
handleList: [
67
// data science
78
'ACRush',

0 commit comments

Comments
 (0)