Testing Migrations
This commit is contained in:
1 parent
d9abeb7fb1
commit
9804771a5b
8 files changed
+1109
No files matched your search
@@ -0,0 +1,24 @@
|
||||
--
|
||||
-- Reference data required for a working database.
|
||||
--
|
||||
-- Applied by ./migrateDatabase.sh after migrations. Kept out of the migration
|
||||
-- history on purpose: environments that were baselined with
|
||||
-- `prisma migrate resolve` never execute 0_init, so seed rows placed inside it
|
||||
-- would silently never exist there.
|
||||
--
|
||||
-- Idempotent, so re-running is harmless.
|
||||
--
|
||||
|
||||
-- attachment_type is a lookup table the application joins against.
|
||||
-- attachment_type = 1 is hardcoded for scraped URLs, 2 for uploaded images,
|
||||
-- 3 for PDFs (see server/models/Attachment.js). Without these rows a freshly
|
||||
-- scaffolded database creates attachments that reference nothing.
|
||||
INSERT INTO `attachment_type` (`id`, `mime_type`, `extension`, `name`) VALUES
|
||||
(1, NULL, NULL, 'URL'),
|
||||
(2, NULL, '.jpg', 'Image - Jpg'),
|
||||
(3, NULL, '.pdf', 'PDF'),
|
||||
(4, NULL, '.doc', 'DOC')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`mime_type` = VALUES(`mime_type`),
|
||||
`extension` = VALUES(`extension`),
|
||||
`name` = VALUES(`name`);
|
||||
Reference in new issue
Block a user