You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Atualiza o script de dados ENGLISH para usar UUIDs corretos em user_id e relações, convertendo os INSERTs de INTEGER para UUIDs compatíveis com auth.users. Inclui ajustes nas inserts de company_profiles, profiles, jobs, applications, notifications e outros elementos que dependem de IDs UUID.
X-Lovable-Edit-ID: edt-6974c99e-31e3-470a-bfed-8afa16189e34
-- Get 5 real UUIDs for candidates from auth.users
29
+
('PUT-REAL-CANDIDATE-UUID-1'::uuid, 'candidate'),
30
+
('PUT-REAL-CANDIDATE-UUID-2'::uuid, 'candidate'),
31
+
('PUT-REAL-CANDIDATE-UUID-3'::uuid, 'candidate'),
32
+
('PUT-REAL-CANDIDATE-UUID-4'::uuid, 'candidate'),
33
+
('PUT-REAL-CANDIDATE-UUID-5'::uuid, 'candidate'),
34
+
35
+
-- Get 5 real UUIDs for companies from auth.users
36
+
('PUT-REAL-COMPANY-UUID-1'::uuid, 'company'),
37
+
('PUT-REAL-COMPANY-UUID-2'::uuid, 'company'),
38
+
('PUT-REAL-COMPANY-UUID-3'::uuid, 'company'),
39
+
('PUT-REAL-COMPANY-UUID-4'::uuid, 'company'),
40
+
('PUT-REAL-COMPANY-UUID-5'::uuid, 'company')
35
41
ON CONFLICT (user_id, role) DO NOTHING;
36
42
37
43
-- ============================================
38
44
-- INSERTING CANDIDATE PROFILES (at least 5 records)
39
45
-- ============================================
40
46
47
+
-- ⚠️ Use the same candidate UUIDs from user_roles above
41
48
INSERT INTO profiles (
42
49
id,
43
50
full_name,
@@ -48,17 +55,18 @@ INSERT INTO profiles (
48
55
about_me,
49
56
linkedin_url
50
57
) VALUES
51
-
('11111111-1111-1111-1111-111111111111', 'Ana Silva Santos', 'São Paulo', 'SP', 'Pleno', 'Desenvolvimento Web', 'Desenvolvedora Full Stack com 3 anos de experiência', 'https://linkedin.com/in/anasilva'),
52
-
('11111111-1111-1111-1111-111111111112', 'Carlos Eduardo Oliveira', 'Rio de Janeiro', 'RJ', 'Sênior', 'DevOps', 'Especialista em infraestrutura cloud', 'https://linkedin.com/in/carloseduardo'),
53
-
('11111111-1111-1111-1111-111111111113', 'Mariana Costa Lima', 'Belo Horizonte', 'MG', 'Júnior', 'UI/UX Design', 'Designer apaixonada por criar experiências incríveis', 'https://linkedin.com/in/marianacosta'),
54
-
('11111111-1111-1111-1111-111111111114', 'Pedro Henrique Santos', 'Porto Alegre', 'RS', 'Pleno', 'Análise de Dados', 'Analista de dados com foco em business intelligence', 'https://linkedin.com/in/pedrosantos'),
55
-
('11111111-1111-1111-1111-111111111115', 'Juliana Ferreira Souza', 'Curitiba', 'PR', 'Júnior', 'Marketing Digital', 'Profissional de marketing com experiência em redes sociais', 'https://linkedin.com/in/julianaferreira')
58
+
('PUT-REAL-CANDIDATE-UUID-1'::uuid, 'Ana Silva Santos', 'São Paulo', 'SP', 'Pleno', 'Desenvolvimento Web', 'Desenvolvedora Full Stack com 3 anos de experiência', 'https://linkedin.com/in/anasilva'),
59
+
('PUT-REAL-CANDIDATE-UUID-2'::uuid, 'Carlos Eduardo Oliveira', 'Rio de Janeiro', 'RJ', 'Sênior', 'DevOps', 'Especialista em infraestrutura cloud', 'https://linkedin.com/in/carloseduardo'),
60
+
('PUT-REAL-CANDIDATE-UUID-3'::uuid, 'Mariana Costa Lima', 'Belo Horizonte', 'MG', 'Júnior', 'UI/UX Design', 'Designer apaixonada por criar experiências incríveis', 'https://linkedin.com/in/marianacosta'),
61
+
('PUT-REAL-CANDIDATE-UUID-4'::uuid, 'Pedro Henrique Santos', 'Porto Alegre', 'RS', 'Pleno', 'Análise de Dados', 'Analista de dados com foco em business intelligence', 'https://linkedin.com/in/pedrosantos'),
62
+
('PUT-REAL-CANDIDATE-UUID-5'::uuid, 'Juliana Ferreira Souza', 'Curitiba', 'PR', 'Júnior', 'Marketing Digital', 'Profissional de marketing com experiência em redes sociais', 'https://linkedin.com/in/julianaferreira')
56
63
ON CONFLICT (id) DO NOTHING;
57
64
58
65
-- ============================================
59
66
-- INSERTING COMPANY PROFILES (at least 5 records)
60
67
-- ============================================
61
68
69
+
-- ⚠️ Use the same company UUIDs from user_roles above
62
70
INSERT INTO company_profiles (
63
71
user_id,
64
72
fantasy_name,
@@ -69,17 +77,18 @@ INSERT INTO company_profiles (
69
77
description,
70
78
about
71
79
) VALUES
72
-
('22222222-2222-2222-2222-222222222221', 'TechInova Solutions', '12.345.678/0001-90', 'Technology', 'São Paulo', 'SP', 'Software development company', 'Leaders in digital transformation'),
73
-
('22222222-2222-2222-2222-222222222222', 'DataCo Analytics', '23.456.789/0001-01', 'Data Science', 'Rio de Janeiro', 'RJ', 'Data analysis and AI', 'Transforming data into insights'),
('PUT-REAL-COMPANY-UUID-1'::uuid, 'TechInova Solutions', '12.345.678/0001-90', 'Technology', 'São Paulo', 'SP', 'Software development company', 'Leaders in digital transformation'),
81
+
('PUT-REAL-COMPANY-UUID-2'::uuid, 'DataCo Analytics', '23.456.789/0001-01', 'Data Science', 'Rio de Janeiro', 'RJ', 'Data analysis and AI', 'Transforming data into insights'),
-- ⚠️ Use the same company UUIDs from company_profiles above
83
92
INSERT INTO jobs (
84
93
company_id,
85
94
title,
@@ -90,30 +99,30 @@ INSERT INTO jobs (
90
99
is_remote,
91
100
required_experience_level
92
101
) VALUES
93
-
('22222222-2222-2222-2222-222222222221', 'Full Stack Developer', 'Develop web applications with React and Node.js', 'CLT', 'São Paulo, SP', 'R$ 8.000 - R$ 12.000', true, 'Pleno'),
94
-
('22222222-2222-2222-2222-222222222222', 'Data Scientist', 'Analyze data and build ML models', 'PJ', 'Rio de Janeiro, RJ', 'R$ 10.000 - R$ 15.000', true, 'Sênior'),
('22222222-2222-2222-2222-222222222225', 'Social Media Manager', 'Manage social media campaigns', 'PJ', 'Curitiba, PR', 'R$ 4.000 - R$ 6.000', true, 'Júnior')
102
+
('PUT-REAL-COMPANY-UUID-1'::uuid, 'Full Stack Developer', 'Develop web applications with React and Node.js', 'CLT', 'São Paulo, SP', 'R$ 8.000 - R$ 12.000', true, 'Pleno'),
103
+
('PUT-REAL-COMPANY-UUID-2'::uuid, 'Data Scientist', 'Analyze data and build ML models', 'PJ', 'Rio de Janeiro, RJ', 'R$ 10.000 - R$ 15.000', true, 'Sênior'),
--Now insert ratings (get actual application IDs first)
140
+
--⚠️ Use the UUIDs you set above
132
141
INSERT INTO ratings (
133
142
application_id,
134
143
rater_id,
@@ -137,38 +146,39 @@ INSERT INTO ratings (
137
146
comment
138
147
) VALUES
139
148
-- Company rating candidate
140
-
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), '22222222-2222-2222-2222-222222222222', '11111111-1111-1111-1111-111111111112', 4.5, 'Excellent professional, delivered on time'),
149
+
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), 'PUT-REAL-COMPANY-UUID-2'::uuid, 'PUT-REAL-CANDIDATE-UUID-2'::uuid, 4.5, 'Excellent professional, delivered on time'),
141
150
-- Candidate rating company
142
-
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), '11111111-1111-1111-1111-111111111112', '22222222-2222-2222-2222-222222222222', 5.0, 'Great company to work with'),
151
+
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), 'PUT-REAL-CANDIDATE-UUID-2'::uuid, 'PUT-REAL-COMPANY-UUID-2'::uuid, 5.0, 'Great company to work with'),
143
152
-- More ratings
144
-
((SELECT id FROM applications WHERE status ='accepted' OFFSET 1LIMIT1), '22222222-2222-2222-2222-222222222225', '11111111-1111-1111-1111-111111111115', 4.0, 'Good work ethic'),
145
-
((SELECT id FROM applications WHERE status ='accepted' OFFSET 1LIMIT1), '11111111-1111-1111-1111-111111111115', '22222222-2222-2222-2222-222222222225', 4.5, 'Professional environment'),
146
-
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), '22222222-2222-2222-2222-222222222221', '11111111-1111-1111-1111-111111111111', 5.0, 'Outstanding developer')
153
+
((SELECT id FROM applications WHERE status ='accepted' OFFSET 1LIMIT1), 'PUT-REAL-COMPANY-UUID-5'::uuid, 'PUT-REAL-CANDIDATE-UUID-5'::uuid, 4.0, 'Good work ethic'),
154
+
((SELECT id FROM applications WHERE status ='accepted' OFFSET 1LIMIT1), 'PUT-REAL-CANDIDATE-UUID-5'::uuid, 'PUT-REAL-COMPANY-UUID-5'::uuid, 4.5, 'Professional environment'),
155
+
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), 'PUT-REAL-COMPANY-UUID-1'::uuid, 'PUT-REAL-CANDIDATE-UUID-1'::uuid, 5.0, 'Outstanding developer')
147
156
ON CONFLICT DO NOTHING;
148
157
149
158
-- ============================================
150
159
-- INSERTING NOTIFICATIONS (at least 5 records)
151
160
-- ============================================
152
161
162
+
-- ⚠️ Use the UUIDs you set above
153
163
INSERT INTO notifications (
154
164
user_id,
155
165
title,
156
166
message,
157
167
type,
158
168
related_id
159
169
) VALUES
160
-
('11111111-1111-1111-1111-111111111111', 'New Match!', 'You matched with TechInova Solutions', 'match', (SELECT id FROM jobs WHERE title ='Full Stack Developer'LIMIT1)),
161
-
('22222222-2222-2222-2222-222222222222', 'New Application', 'Ana Silva Santos applied for your job', 'new_application', (SELECT id FROM applications WHERE candidate_id ='11111111-1111-1111-1111-111111111111'LIMIT1)),
162
-
('11111111-1111-1111-1111-111111111112', 'Application Accepted!', 'Your application was accepted', 'application_accepted', (SELECT id FROM applications WHERE candidate_id ='11111111-1111-1111-1111-111111111112'LIMIT1)),
163
-
('11111111-1111-1111-1111-111111111113', 'Profile Viewed', 'DesignHub Studio viewed your profile', 'profile_view', NULL),
164
-
('22222222-2222-2222-2222-222222222221', 'New Rating', 'You received a 5-star rating', 'new_rating', (SELECT id FROM ratings WHERE rated_user_id ='22222222-2222-2222-2222-222222222221'LIMIT1))
170
+
('PUT-REAL-CANDIDATE-UUID-1'::uuid, 'New Match!', 'You matched with TechInova Solutions', 'match', (SELECT id FROM jobs WHERE title ='Full Stack Developer'LIMIT1)),
171
+
('PUT-REAL-COMPANY-UUID-2'::uuid, 'New Application', 'Ana Silva Santos applied for your job', 'new_application', (SELECT id FROM applications WHERE candidate_id ='PUT-REAL-CANDIDATE-UUID-1'::uuidLIMIT1)),
172
+
('PUT-REAL-CANDIDATE-UUID-2'::uuid, 'Application Accepted!', 'Your application was accepted', 'application_accepted', (SELECT id FROM applications WHERE candidate_id ='PUT-REAL-CANDIDATE-UUID-2'::uuidLIMIT1)),
173
+
('PUT-REAL-CANDIDATE-UUID-3'::uuid, 'Profile Viewed', 'DesignHub Studio viewed your profile', 'profile_view', NULL),
174
+
('PUT-REAL-COMPANY-UUID-1'::uuid, 'New Rating', 'You received a 5-star rating', 'new_rating', (SELECT id FROM ratings WHERE rated_user_id ='PUT-REAL-COMPANY-UUID-1'::uuidLIMIT1))
((SELECT id FROM applications WHERE contract_status ='completed'LIMIT1), '11111111-1111-1111-1111-111111111112', '22222222-2222-2222-2222-222222222222', 'DevOps Engineer', 'Amazing experience working here. Great team and challenging projects.', 'approved'),
181
-
((SELECT id FROM applications WHERE contract_status ='completed' OFFSET 1LIMIT1), '11111111-1111-1111-1111-111111111115', '22222222-2222-2222-2222-222222222225', 'Social Media Manager', 'Learned a lot and had great support from the team.', 'approved'),
182
-
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), '11111111-1111-1111-1111-111111111111', '22222222-2222-2222-2222-222222222221', 'Full Stack Developer', 'Professional environment with growth opportunities.', 'pending'),
183
-
((SELECT id FROM applications WHERE status ='accepted' OFFSET 2LIMIT1), '11111111-1111-1111-1111-111111111113', '22222222-2222-2222-2222-222222222223', 'UI/UX Designer', 'Creative freedom and supportive leadership.', 'approved'),
184
-
((SELECT id FROM applications WHERE status ='accepted' OFFSET 3LIMIT1), '11111111-1111-1111-1111-111111111114', '22222222-2222-2222-2222-222222222224', 'Data Scientist', 'Innovative company with cutting-edge technology.', 'pending')
190
+
((SELECT id FROM applications WHERE contract_status ='completed'LIMIT1), 'PUT-REAL-CANDIDATE-UUID-2'::uuid, 'PUT-REAL-COMPANY-UUID-2'::uuid, 'DevOps Engineer', 'Amazing experience working here. Great team and challenging projects.', 'approved'),
191
+
((SELECT id FROM applications WHERE contract_status ='completed' OFFSET 1LIMIT1), 'PUT-REAL-CANDIDATE-UUID-5'::uuid, 'PUT-REAL-COMPANY-UUID-5'::uuid, 'Social Media Manager', 'Learned a lot and had great support from the team.', 'approved'),
192
+
((SELECT id FROM applications WHERE status ='accepted'LIMIT1), 'PUT-REAL-CANDIDATE-UUID-1'::uuid, 'PUT-REAL-COMPANY-UUID-1'::uuid, 'Full Stack Developer', 'Professional environment with growth opportunities.', 'pending'),
193
+
((SELECT id FROM applications WHERE status ='accepted' OFFSET 2LIMIT1), 'PUT-REAL-CANDIDATE-UUID-3'::uuid, 'PUT-REAL-COMPANY-UUID-3'::uuid, 'UI/UX Designer', 'Creative freedom and supportive leadership.', 'approved'),
194
+
((SELECT id FROM applications WHERE status ='accepted' OFFSET 3LIMIT1), 'PUT-REAL-CANDIDATE-UUID-4'::uuid, 'PUT-REAL-COMPANY-UUID-4'::uuid, 'Data Scientist', 'Innovative company with cutting-edge technology.', 'pending')
0 commit comments