Преглед на файлове

:recycle: removing user_media from profile generation and seed

tags/0.0.1
J преди 4 години
родител
ревизия
be0879e8f7
променени са 3 файла, в които са добавени 1 реда и са изтрити 6 реда
  1. 0
    1
      backend/db/data-generator/classes.js
  2. 1
    4
      backend/db/data-generator/index.js
  3. 0
    1
      backend/db/migrations/20210527173933_create_profiles_table.js

+ 0
- 1
backend/db/data-generator/classes.js Целия файл

11
     constructor(id, override) {
11
     constructor(id, override) {
12
         this.user_id = override?.user_id ? override.user_id : id
12
         this.user_id = override?.user_id ? override.user_id : id
13
         this.profile_id = override?.profile_id ? override.profile_id + id : id
13
         this.profile_id = override?.profile_id ? override.profile_id + id : id
14
-        this.user_media = ''
15
     }
14
     }
16
 }
15
 }
17
 class Response {
16
 class Response {

+ 1
- 4
backend/db/data-generator/index.js Целия файл

82
         starting: config.batchSize * batchCount,
82
         starting: config.batchSize * batchCount,
83
         profile_id: extraProfileCount,
83
         profile_id: extraProfileCount,
84
     })
84
     })
85
-    profiles.forEach(profile => {
86
-        profile.user_media = random.media()
87
-    })
85
+
88
     // Generate extra job posting profiles
86
     // Generate extra job posting profiles
89
     // attributed to random user.is_poster === true
87
     // attributed to random user.is_poster === true
90
     // TODO: Clean this up. Hard to read...
88
     // TODO: Clean this up. Hard to read...
102
             extras = [...extras, ...generatedExtraProfiles]
100
             extras = [...extras, ...generatedExtraProfiles]
103
         }
101
         }
104
         extras.forEach(profile => {
102
         extras.forEach(profile => {
105
-            profile.user_media = random.media()
106
             profiles.push(profile)
103
             profiles.push(profile)
107
             extraProfileCount++
104
             extraProfileCount++
108
         })
105
         })

+ 0
- 1
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')
6
     })
5
     })
7
 }
6
 }
8
 
7
 

Loading…
Отказ
Запис