@@ -15,9 +15,11 @@ Table jobs {
1515 isRemote Boolean
1616 createdAt DateTime [default: `now()`, not null]
1717 updatedAt DateTime [not null]
18+ source String
19+ externalId String
20+ data Json
1821 tags job_tags [not null]
1922 metadata job_metadata [not null]
20- sources job_sources [not null]
2123
2224 Note: 'Stores job listings from all sources (Reddit, Web3Career, etc).
2325Contains only the main, normalized/shared job fields.'
@@ -74,24 +76,6 @@ Table job_metadata {
7476Allows storage of extra source-specific or custom fields.'
7577}
7678
77- Table job_sources {
78- id Int [pk, increment]
79- jobId Int [not null]
80- source String [not null]
81- externalId String
82- rawUrl String
83- data Json
84- createdAt DateTime [default: `now()`, not null]
85- job jobs [not null]
86-
87- indexes {
88- (source, externalId) [unique]
89- }
90-
91- Note: 'Tracks the source(s) from which this job was imported.
92- Used for provenance, deduplication, and full source data storage.'
93- }
94-
9579Table taggables {
9680 id Int [pk, increment]
9781 tagId Int [not null]
@@ -145,6 +129,9 @@ Table users {
145129 password String [not null]
146130 firstname String
147131 lastname String
132+ username String
133+ profilePicture String
134+ googleId String [unique]
148135 role Role [not null, default: 'USER']
149136 wallet String [unique]
150137 is_active Boolean [default: true]
@@ -233,8 +220,6 @@ Ref: job_tags.tagId > tags.id
233220
234221Ref: job_metadata.jobId > jobs.id
235222
236- Ref: job_sources.jobId > jobs.id
237-
238223Ref: taggables.tagId > tags.id
239224
240- Ref: locations.subscriptionId > subscriptions.id
225+ Ref: locations.subscriptionId > subscriptions.id [delete: Cascade]
0 commit comments