@@ -51,9 +51,9 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
5151 await queryRunner . connect ( ) ;
5252 await queryRunner . startTransaction ( ) ;
5353
54- // Create a test namespace that resources can reference
54+ // Create a test namespace specific to this migration test
5555 await queryRunner . query ( `
56- INSERT INTO namespaces (id, name) VALUES ('test-ns ', 'Test Namespace ')
56+ INSERT INTO namespaces (id, name) VALUES ('update-attachment-urls-test ', 'UpdateAttachmentUrls Migration Test ')
5757 ON CONFLICT (id) DO NOTHING
5858 ` ) ;
5959 } ) ;
@@ -72,9 +72,9 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
7272 // Setup: Insert resources with old-style image attachment URLs
7373 await queryRunner . query ( `
7474 INSERT INTO resources (id, name, namespace_id, resource_type, content) VALUES
75- ('res1', 'Test Document 1', 'test-ns ', 'doc', 'Here is an image: /api/v1/attachments/images/abc123.jpg'),
76- ('res2', 'Test Document 2', 'test-ns ', 'doc', 'Multiple images: /api/v1/attachments/images/test1.png and /api/v1/attachments/images/test2.gif'),
77- ('res3', 'Test Document 3', 'test-ns ', 'doc', 'No attachments here')
75+ ('res1', 'Test Document 1', 'update-attachment-urls-test ', 'doc', 'Here is an image: /api/v1/attachments/images/abc123.jpg'),
76+ ('res2', 'Test Document 2', 'update-attachment-urls-test ', 'doc', 'Multiple images: /api/v1/attachments/images/test1.png and /api/v1/attachments/images/test2.gif'),
77+ ('res3', 'Test Document 3', 'update-attachment-urls-test ', 'doc', 'No attachments here')
7878 ` ) ;
7979
8080 // Execute migration
@@ -84,7 +84,7 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
8484 // Verify results for our specific test resources only
8585 const results = await queryRunner . query ( `
8686 SELECT id, content FROM resources
87- WHERE namespace_id = 'test-ns ' AND id IN ('res1', 'res2', 'res3')
87+ WHERE namespace_id = 'update-attachment-urls-test ' AND id IN ('res1', 'res2', 'res3')
8888 ORDER BY id
8989 ` ) ;
9090
@@ -103,9 +103,9 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
103103 // Setup: Insert resources with old-style media attachment URLs
104104 await queryRunner . query ( `
105105 INSERT INTO resources (id, name, namespace_id, resource_type, content) VALUES
106- ('res1', 'Audio Document', 'test-ns ', 'doc', 'Audio file: /api/v1/attachments/media/audio123.wav'),
107- ('res2', 'Video Document', 'test-ns ', 'doc', 'Video: /api/v1/attachments/media/video456.mp4'),
108- ('res3', 'Mixed Media', 'test-ns ', 'doc', 'Mixed: /api/v1/attachments/images/pic.jpg and /api/v1/attachments/media/sound.mp3')
106+ ('res1', 'Audio Document', 'update-attachment-urls-test ', 'doc', 'Audio file: /api/v1/attachments/media/audio123.wav'),
107+ ('res2', 'Video Document', 'update-attachment-urls-test ', 'doc', 'Video: /api/v1/attachments/media/video456.mp4'),
108+ ('res3', 'Mixed Media', 'update-attachment-urls-test ', 'doc', 'Mixed: /api/v1/attachments/images/pic.jpg and /api/v1/attachments/media/sound.mp3')
109109 ` ) ;
110110
111111 // Execute migration
@@ -115,7 +115,7 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
115115 // Verify results for our specific test resources only
116116 const results = await queryRunner . query ( `
117117 SELECT id, content FROM resources
118- WHERE namespace_id = 'test-ns ' AND id IN ('res1', 'res2', 'res3')
118+ WHERE namespace_id = 'update-attachment-urls-test ' AND id IN ('res1', 'res2', 'res3')
119119 ORDER BY id
120120 ` ) ;
121121
@@ -133,7 +133,7 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
133133 // Setup: Insert resources with mix of old and new URLs
134134 await queryRunner . query ( `
135135 INSERT INTO resources (id, name, namespace_id, resource_type, content) VALUES
136- ('res1', 'Mixed URLs', 'test-ns ', 'doc',
136+ ('res1', 'Mixed URLs', 'update-attachment-urls-test ', 'doc',
137137 'Old: /api/v1/attachments/images/old.jpg New: attachments/new.png Already converted: attachments/existing.gif')
138138 ` ) ;
139139
@@ -155,7 +155,7 @@ describe('UpdateAttachmentUrls Migration E2E', () => {
155155 // Setup: Insert resources with other API URLs that should not be changed
156156 await queryRunner . query ( `
157157 INSERT INTO resources (id, name, namespace_id, resource_type, content) VALUES
158- ('res1', 'Other APIs', 'test-ns ', 'doc',
158+ ('res1', 'Other APIs', 'update-attachment-urls-test ', 'doc',
159159 'These should not change: /api/v1/resources/123 /api/v1/auth/login /api/v1/users/profile
160160 But this should: /api/v1/attachments/images/photo.jpg
161161 And this: /api/v1/attachments/media/video.mp4')
0 commit comments