Преглед изворни кода

:bug: fixing profile schema change bug | added image url for profiles

tags/0.0.1
J пре 4 година
родитељ
комит
6d72a8a5ea

+ 2
- 10
backend/db/data-generator/index.js Прегледај датотеку

84
         profile_id: extraProfileCount,
84
         profile_id: extraProfileCount,
85
     })
85
     })
86
     profiles.forEach(profile => {
86
     profiles.forEach(profile => {
87
-        var mediaArray = []
88
-        for (let i = 0; i < 3; i++) {
89
-            mediaArray.push(random.media())
90
-        }
91
-        profile.user_media = mediaArray
87
+        profile.user_media = random.media()
92
     })
88
     })
93
     // Generate extra job posting profiles
89
     // Generate extra job posting profiles
94
     // attributed to random user.is_poster === true
90
     // attributed to random user.is_poster === true
107
             extras = [...extras, ...generatedExtraProfiles]
103
             extras = [...extras, ...generatedExtraProfiles]
108
         }
104
         }
109
         extras.forEach(profile => {
105
         extras.forEach(profile => {
110
-            var mediaArray = []
111
-            for (let i = 0; i < 3; i++) {
112
-                mediaArray.push(random.media())
113
-            }
114
-            profile.user_media = mediaArray
106
+            profile.user_media = random.media()
115
             profiles.push(profile)
107
             profiles.push(profile)
116
             extraProfileCount++
108
             extraProfileCount++
117
         })
109
         })

+ 1
- 0
backend/db/migrations/20210527173933_create_profiles_table.js Прегледај датотеку

2
     return knex.schema.createTable('profiles', function (table) {
2
     return knex.schema.createTable('profiles', function (table) {
3
         table.increments('profile_id').primary()
3
         table.increments('profile_id').primary()
4
         table.integer('user_id').notNullable()
4
         table.integer('user_id').notNullable()
5
+        table.string('user_media')
5
     })
6
     })
6
 }
7
 }
7
 
8
 

+ 10
- 0
backend/db/mock.js Прегледај датотеку

1
+module.exports = {
2
+    users: [],
3
+    profiles: [],
4
+    response_keys: [],
5
+    responses: [],
6
+    memberships: [],
7
+    groupings: [],
8
+    messages: [],
9
+    match_queues: [],
10
+}

Loading…
Откажи
Сачувај