Ship Novya PWA with backend for deployable production use.
Fix production TypeScript builds and add DEPLOY.md so the app can be hosted from this repo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
-- Deduplicate assessment_attempts before adding UNIQUE(userId, phase).
|
||||
-- Keep the newest row per (userId, phase); child rows cascade on delete.
|
||||
|
||||
DELETE FROM `assessment_attempts`
|
||||
WHERE `id` IN (
|
||||
SELECT `id` FROM (
|
||||
SELECT a.`id`
|
||||
FROM `assessment_attempts` a
|
||||
INNER JOIN `assessment_attempts` keeper
|
||||
ON keeper.`userId` = a.`userId`
|
||||
AND keeper.`phase` = a.`phase`
|
||||
AND (
|
||||
keeper.`submittedAt` > a.`submittedAt`
|
||||
OR (keeper.`submittedAt` = a.`submittedAt` AND keeper.`id` > a.`id`)
|
||||
)
|
||||
) AS duplicates
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `uq_assessment_attempts_user_phase` ON `assessment_attempts`(`userId`, `phase`);
|
||||
Reference in New Issue
Block a user