Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
4bd3e65
Updated 'users' resolver to include 'role' param, and added findByAff…
jupiter007 Jun 17, 2026
b458aa1
Added unit tests for updates to models
jupiter007 Jun 18, 2026
0af20b4
Removed console.log
jupiter007 Jun 18, 2026
5bd67a3
Fixed issue with 'findByAffiliationIdAndUserRole' resolver
jupiter007 Jun 18, 2026
9373067
Addressed a couple of vulnerabilities
jupiter007 Jun 18, 2026
bce8a98
removed findByAffiliationIdAndUserRole since it was almost identical …
jupiter007 Jun 18, 2026
115641f
Added affiliationId variable to 'users' resolver
jupiter007 Jun 22, 2026
6314f69
Added affiliationId variable to 'users' resolver
jupiter007 Jun 22, 2026
e8fee59
added a research output question to the local default template
briri Jun 22, 2026
7586fca
Merge pull request #771 from CDLUC3/feature/ro-question-default-template
briri Jun 23, 2026
2708118
Address security vulnerabilities in nodemailer and indici packages an…
jupiter007 Jun 23, 2026
506b763
Removed duplicate code in search function
jupiter007 Jun 23, 2026
204831a
Merge pull request #768 from CDLUC3/feature/240/JS-load-users-on-admi…
jupiter007 Jun 23, 2026
1ff6565
merged development into branch
jupiter007 Jun 23, 2026
81c7069
Merge pull request #772 from CDLUC3/bug/285/JS-request-feedback-failing
jupiter007 Jun 24, 2026
0de5573
Initial updates for the new admin user profile page
jupiter007 Jun 24, 2026
667671f
Made sure templateTitle is returned
jupiter007 Jun 25, 2026
06e2bc6
fix bug in data migration to add research output question to default …
briri Jun 25, 2026
8c6ec9f
Merge pull request #773 from CDLUC3/feature/ro-question-default-template
briri Jun 25, 2026
b9fa6ad
Added archiveUser resolver and userProjects query resolver
jupiter007 Jun 26, 2026
15bd915
Added isArchived field to users table
jupiter007 Jun 26, 2026
bac5549
Added unit test for Plan model
jupiter007 Jun 26, 2026
2bd0bfb
Removed debugging logs from requestFeedback, and added better messagi…
jupiter007 Jun 27, 2026
04732e2
Removed it.only from test
jupiter007 Jun 29, 2026
67058d7
added SQL scripts folder
briri Jun 29, 2026
ea2b08a
updated changelog
briri Jun 29, 2026
afc7c51
Responded to PR comments
jupiter007 Jun 29, 2026
9078f57
replace all CURDATE in SQL files with NOW
briri Jun 29, 2026
6e77ea2
Updated 'user' to 'planCreator' for plans chained resolver
jupiter007 Jun 29, 2026
f68d5e9
removed errors for when there are no feedbackEmails or feedbackEnable…
jupiter007 Jun 29, 2026
e5eaacd
merged development into branch
jupiter007 Jun 29, 2026
034b09a
Merge pull request #774 from CDLUC3/feature/281/JS-create-editable-us…
jupiter007 Jun 29, 2026
92faea2
updated Answer model to use Default research output type from dmptool…
briri Jun 30, 2026
a0db336
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jun 30, 2026
d341fd8
Merge pull request #776 from CDLUC3/bug/plan-owner
briri Jun 30, 2026
343116d
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jun 30, 2026
0e41c4d
Merge pull request #775 from CDLUC3/bug/285/JS-debugging-request-feed…
jupiter007 Jun 30, 2026
b130b3d
Added contactUs resolver and schema
jupiter007 Jul 7, 2026
64d01c5
Updated VersionedGuidance and Guidance models to make tagId be optional
jupiter007 Jul 7, 2026
9d0d337
Merge pull request #778 from CDLUC3/feature/297/JS-add-contactUs-email
jupiter007 Jul 8, 2026
18152b7
merged development into branch
jupiter007 Jul 8, 2026
79061b3
Merge pull request #779 from CDLUC3/bug/54/JS-publish-guidance-error
jupiter007 Jul 8, 2026
bcd6318
Added EZID config and datasource for registering dmpIds with EZID
jupiter007 Jul 9, 2026
71ad59d
fixed some lingering issues and updated to use new versions of @dmpto…
briri Jul 10, 2026
bfbdd9b
removed debug line
briri Jul 10, 2026
11b4025
added logic to fix researchOutput answers
briri Jul 10, 2026
2d838cf
Added an updatePlan mutation to allow all Plan properties to be updat…
briri Jul 13, 2026
66a36fb
generated graphql types
briri Jul 13, 2026
825edb6
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jul 13, 2026
48d9214
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jul 13, 2026
27406b3
Merge pull request #780 from CDLUC3/bug/ro-json
briri Jul 13, 2026
633c635
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jul 13, 2026
b067b0c
added updatePlan resolver for rest API
briri Jul 14, 2026
24984a7
cleaned up spacing issue in plan resolver
briri Jul 14, 2026
7c5b74b
update changelog
briri Jul 14, 2026
3541d37
Removed ezid password from .env.example
jupiter007 Jul 14, 2026
e31edc1
Added new dataciteXMLService and added new buildDataCiteXMLForPlan to…
jupiter007 Jul 15, 2026
836af1f
removed duplicate comment
jupiter007 Jul 15, 2026
b3ffc1d
Merge pull request #783 from CDLUC3/feature/update-delete-api-support
briri Jul 15, 2026
fe9d818
Updated to send XML metadata for EZID DOI registration
jupiter007 Jul 15, 2026
6155e32
Updated datacitXMLService to use the ORCID REGEX defined in utils/hel…
jupiter007 Jul 15, 2026
37f4503
merged development into branch
jupiter007 Jul 15, 2026
1ea3b2e
Merge pull request #782 from CDLUC3/feature/32/JS-ezid-registration
jupiter007 Jul 15, 2026
b0a028f
Fixed build issue because package-lock.json was referencing a file fo…
jupiter007 Jul 16, 2026
55d0057
Merge pull request #786 from CDLUC3/bug/JS-fix-issue-with-dmptool-uti…
jupiter007 Jul 16, 2026
d8a2845
finished up changes to support updates in rest api
briri Jul 16, 2026
32687db
ran npm generate
briri Jul 16, 2026
fbb6c2d
merged latest development
briri Jul 16, 2026
742ae36
Updated addProjectMember and updateProjectMember resolvers to use a n…
jupiter007 Jul 17, 2026
9564f3f
Added unit test for resolveAffiiation method in affiliationService
jupiter007 Jul 17, 2026
8ff712f
responded to PR comments
jupiter007 Jul 21, 2026
8e7134c
Merge pull request #787 from CDLUC3/feature/309-update-projectMember-…
briri Jul 21, 2026
347c60b
added MySQL transaction client and the ability to pass it around. Sta…
briri Jul 21, 2026
bbdda81
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jul 21, 2026
a397eaa
Updated brace-expansion to v5.0.7 and js-yaml to v4.3.0 to address HI…
jupiter007 Jul 21, 2026
5849788
Merge pull request #790 from CDLUC3/chore/310/JS-fix-vulnerabilites
briri Jul 21, 2026
9200267
Added plans chained resolver to ProjectSearchResult in project resolv…
jupiter007 Jul 22, 2026
5ca56c3
updated immutable to v5.1.9 to address vulnerability
jupiter007 Jul 22, 2026
eb65ef4
Merge pull request #791 from CDLUC3/feature/304/JS-update-for-admin-p…
jupiter007 Jul 22, 2026
b5f5302
Updated sendContactUsEmail in emailService.ts to not include a bcc ad…
jupiter007 Jul 22, 2026
b93d65a
Fixed 'removeProjectFunding' bugs
jupiter007 Jul 22, 2026
8979588
reverted changes since on wrong branch
jupiter007 Jul 22, 2026
ac8b2e0
Fixed bugs in removeProjectFunding to get it to work
jupiter007 Jul 22, 2026
148fe09
Add comprehensive unit tests for transactionalProcessingService with …
briri Jul 22, 2026
1c27ba7
finished up mysql transaction support. added new entirePlanService
briri Jul 23, 2026
9ec5325
cleanup of some files
briri Jul 24, 2026
7cbb15b
cleanup after reviewing PR and updated CHANGELOG
briri Jul 24, 2026
40684f2
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jul 24, 2026
5bf16f0
Added additional errors to PLanErrors
briri Jul 24, 2026
c983f6a
fixed issue with addentireplaninput
briri Jul 24, 2026
ba84ecd
fixed issue with addentireplaninput
briri Jul 24, 2026
0b18165
Added new passwordResetTokens table, model, resolver and schema. Adde…
jupiter007 Jul 25, 2026
0fd4ad6
Added new passwordResetTokens table, model, resolver and schema. Adde…
jupiter007 Jul 25, 2026
40e3bce
Added getUserTokenVersion and bumpUserTokenVersion to tokenService
jupiter007 Jul 25, 2026
bab6708
Updated CHANGELOG.md
jupiter007 Jul 25, 2026
3782993
Fixed some unit tests
jupiter007 Jul 25, 2026
a4b9869
Merge pull request #792 from CDLUC3/feature/303/JS-remove-BCC-email-f…
jupiter007 Jul 25, 2026
722fa1e
Added some more logging and validation to PasswordResetToken
jupiter007 Jul 27, 2026
5957ade
Updated CHANGELOG.md
jupiter007 Jul 27, 2026
00e7228
Merge pull request #793 from CDLUC3/bug/311/JS-fix-delete-fundings
jupiter007 Jul 27, 2026
432620b
Added override for brace-expansion to v5.0.8
jupiter007 Jul 27, 2026
d559ab2
Merge pull request #797 from CDLUC3/chore/314/JS-address-vulnerabilities
briri Jul 27, 2026
9df975e
Responded to PR comments
jupiter007 Jul 27, 2026
f2152bf
update to use new EntirePlan prefixed inputs
briri Jul 27, 2026
f46dfaf
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Jul 27, 2026
c820522
fixed error handling in withTransaction
briri Jul 27, 2026
7d8aabd
Merge pull request #794 from CDLUC3/feature/update-delete-api-support
briri Jul 28, 2026
5eeeed0
merged development into branch
jupiter007 Jul 28, 2026
8bf74b2
Merge pull request #796 from CDLUC3/feature/133/JS-add-password-reset…
jupiter007 Jul 28, 2026
1ce1a0d
Added back the missing 'fast-xml-parser' which is needed for 're3data…
jupiter007 Jul 28, 2026
c88d9ab
Merge pull request #798 from CDLUC3/bug/JS-add-missing-fast-xml-parser
briri Jul 29, 2026
b9364f1
Added tags to Question model, and updated Tag model to support adding…
jupiter007 Jul 30, 2026
5e11fdf
minor tweaks to entirePlanX resolvers to support updated dmptool-api
briri Jul 30, 2026
ab657fb
Updated CHANGELOG.md
jupiter007 Jul 30, 2026
b6ae1c2
Corrected comment for tags chained resolver
jupiter007 Jul 31, 2026
390289d
Merge pull request #802 from CDLUC3/feature/274/JS-update-tags
jupiter007 Jul 31, 2026
06213a1
update CHANGELOG
briri Aug 3, 2026
e7a96d5
Merge branch 'development' of github.com:CDLUC3/dmptool-apollo-server…
briri Aug 3, 2026
851a336
Merge pull request #801 from CDLUC3/feature/update-delete-api-support
briri Aug 3, 2026
3843611
add overrides for sec vulnerabilities
briri Aug 3, 2026
a55217b
Merge pull request #804 from CDLUC3/chore/upd-deps
briri Aug 3, 2026
1f15e81
Merge pull request #806 from CDLUC3/development
jupiter007 Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@ OPENSEARCH_SERVERLESS_NODE=my-domain.region.es.amazonaws.com
# Also refer to the ENV variables defined in the local docker-compose.yaml file
# those variables will need to be defined along with the ones above when you
# deploy the application to a production environment

# EZID config
EZID_API_URL=https://ezid-stg.cdlib.org/
EZID_USERNAME='test'
EZID_PASSWORD='test123'

# Password Reset (30 minutes)
PASSWORD_RESET_TOKEN_EXPIRY_MS = 1800000
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
## v1.1.0

### Added
- Added override for `minimatch`
- Added versionedTemplate schema and resolver so we can fetch a versioned template by its id.
- Added `questionTags` and `versionedQuestionTags` tables [#274]
- Added `getUserTokenVersion` and `bumpUserTokenVersion` to `tokenService` so that we can save the `tokenVersion` in the `JWT` payload, and validate it against the current version in `isRevokedCallback` on `/graphql` requests [#133]
- Added new `PasswordResetToken` model, `passwordReset` resolver, `passwordReset` schema, and separate `passwordResetTokens` table to store the `resetPasswordToken` and `resetPasswordExpiresAt` [#133]
- Added `passwordChangedAt` field to the `users` table, and `User` model to record when password last changed [#133]
- Added new helper SQL script to delete all existing research output questions and answers
- Added new `TransactionClient` class to the `datasources/mysql.ts` file to allow for the use of MySQL transactions
- Added a `AddAnswerInput`, `AddProjectInput`, `EntirePlanProjectFragment`, `EntirePlanMemberFragment`, `EntirePlanFundingFragment`, `EntirePlanAnswerFragment`, `AddEntirePlanInput`, `UpdateEntirePlanInput` to schema
- Added new `addEntirePlan`, `updateEntirePlan` and `removeEntirePlan` schema and resolvers to allow a caller to include all of the Project, Plan, Member, Funding, Answer and RelatedWork information in one mutation (to support REST API functionality and future integrations)
- Added new `entirePlanService` to support the above resolvers
- Added a new `Funding.findByProjectFundingId`
- Added a new `errorsToString` function to the `MySQLModel`
- Added a new `findByOwnerAndTitle` to the `Plan` model
- Added files for EZID creation: `config/ezidConfig.ts` and `datasources/EZIDAPI.ts`, and updated `Plan.publish` to call on the new `registerIdentifier` [#32]
- Added new `buildDataCiteXMLForPlan` to build XML for EZID registration in `planService.ts` and added new `dataciteXMLService.ts` with helper functions for the new `buildDataCiteXMLForPlan` function [#32]
- Added a `plansByProjectId` query and resolver
- Added an `updatePlan` mutation and resolver
- Added `contactUs` resolver to allow users to send us emails [#297]
- Added a scripts/sql/ directory to store useful maintenance and debugging scripts
- Added `isArchived` field to the `users` table to help us filter those users out when returned in `users` response [#281]
- Added `findByProjectIdWithPagination` method to the `PlanSearchResult` model for the `plans` resolver [#281]
- Added `userProjects` query to return all projects for a specified user, with search term and pagination [#281]
- Added `updateUserRole` mutation for admins to change a user's role, `updateUserInfo` mutation for super admins to update a specified user's profile, and an `archiveUser` mutation to archive a user[#281]
- Added a default researc h output table question to the default template
- Added data migration to add `displayAbbreviation` and `displayDomain` to the `affiliations` table
- Added data migration to backfill those new DB fields
- Added LocalStack port env variable to the docker compose file and `awsConfig` file
Expand Down Expand Up @@ -101,6 +126,32 @@
- added data-migration to fix question JSON so that `"selected": 0` is now `"selected": false` (and `1` -> `true`).

### Updated
- Updated override for `brace-expansion`
- Switched entirePlan schema, resolvers and service to use versionedXId instead of xId (e.g. use versionedTemplates instead of Templates)
- Updated entirePlan service to use the default MemberRole when none is provided
- Updated `Plan.findByPlanId` to prefer questionTags and fall back to sectionTags [#274]
- Updated `Question` model to have `tags`, since we moved the best practice tags to the Question page [#274]
- Updated `Tag` model with functions for adding and removing tags from questions and versioned questions [#274]
- Updated `addQuestion` and `updateQuestion` resolvers to add any tag data to `questionTags` table, and to include `tags` chained resolver [#274]
- Removed `tags` from `section` resolver [#274]
- Updated `addTemplate` mutation resolver so that make sure to copy over questionTags when cloning [#274]
- Updated `guidanceService.ts` to prefer `questionTags` and fall back to `sectionTags` if there are no `questionTags`. That way we can ease into transitioning to `questionTags` [#274]
- Updated `questionService`'s `generateQuestionVersion` to include `questionTags`, and also made sure to add current tags in `generateSectionVersion` before calling `generateQuestionVersion` [#274]
- Updated `emailService` with a `sendResetPasswordEmail` to send an email with the `change password link` [#133]
- Fixed issue with JSON of default questions and answers in the local data migration file
- Renamed old `Funding.findByProjectFundingId` to `Funding.findByPlanAndProjectFundingId`
- Updated `sendContactUsEmail` in `emailService.ts` to not include a `bcc` [#303]
- Added `plans` chained resolver to `ProjectSearchResult` in `project` resolver so that querying `userProjects` will include `plan` data for each project [#304]
- Updated `updateProjectMember` resolver to handle `Other Affiliation`. Added a new, shared `resolveAffiliation` function to `affiliationService.ts`. Updated `updateProjectMember` schema to include `affiliationName` [#309]
- Updated the `Answer` model to use the newly exported `DefaultResearchOutputTypeAnswer` from `@dmptool/types` instead of manually building it
- Updated `Guidance` and `VersionedGuidance` classes to make `tagId` optional, since it was causing errors on `dev` where `guidance` records had no `tagId`. This is consistent with the `guidance` table schema which allows the `tagId` field to be `NULL` [#54]
- Updated `emailService.ts` with the addition of `sendContactUsEmail` [#297]
- Updated `plans` resolver to have pagination for a specified `userId` with optional `search term`, and added a chained resolver for `PlanSearchResult` for `templateOwnerAffiliationName` [#281]
- Updated `PlanSearchResult` model to include `createdById` and `templateOwnerAffiliationName` for the Admin Users page [#281]
- Update local migration to add RO question to default template
- Updated `users` resolver to include `role` and `affiliationId` [#240]
- Added `findByAffiliationId` and `search` to pass in `role` as optional [#240]
- Added `findByUserId` to `Plan` model to find all plans for a given user [#240]
- Updated Trivy scripts to ignore the entire `docker/` directory
- Updated Localstack startup file to remove unused lambda function and SQS.
- Bumped version of `@dmptool/utils`
Expand Down Expand Up @@ -203,6 +254,8 @@
- Updates to appease newer version of eslint

### Removed
- Removed unused `valueIsDate` function from the `MySQLModel`
- Removed old `processResult` functions from the `Answer` and `Question` models. These functions were added to help add the `commonStandardId` to existing JSON records. It proved to be inadequate so we eneded up just deleting old data
- Removed unused SQS env variable from example dotenv file
- Removed override for `brace-expansion` dependency
- Removed overrides for `ws` and `brace-expansion` dependencies
Expand All @@ -224,6 +277,12 @@
- Removed `ioredis` package

### Fixed
- Added missing `fast-xml-parser` back so that `re3data-os-populate.ts` can run
- Fixed `removeProjectFunding`. There were several issues, one of which was not being able to delete a `projectFundings` record without removing it's foreign key dependency in `planFundings` first [#303]
- Updated `immutable` to `v5.1.9` to address HIGH security vulnerability [#304]
- Updated `brace-expansion` to `v5.0.7` and `js-yaml` to `v4.3.0` to address vulnerabilities [#310]
- Build was breaking because of a `package-lock.json` was referencing a file for `dmptool-utils`.
- Updated `requestFeedback` with better error messaging for when `feedbackEnabled` is false or there are no `feedbackEmails`. Also, added checks for `input.subHeaderLinks` and `input.ssoEmailDomains` in `updateAffiliations` since it was breaking that mutation when those fields were not included. Also, removed the debugging I had previously added to investigate the `requestFeedback` resolver failing. [#285]
- Fixed error in `data-migrations/local-only/2026-05-08-1111-seed-project-plan.sql` when inserting data for `templates` and `versionedTemplates` tables which were missing the new `isDefault` value.
- Fixed an issue with duplicate URIs being returned to `findRe3DataByURIs` by deduping [#33]
- Fixed bug in `openSearchService` that was throwing an error and not returning repositories [#196]
Expand All @@ -235,6 +294,9 @@
- Fixed issue with templates not cloning with sections and questions by updating the `addTemplate` mutation to clone from non-versioned template, section and question [#1006]

### Chore
- Added override for `brace-expansion` to `v5.0.8` [#314]
- Addressed security vulnerability in `nodemailer` and `undici` packages, and added debugging to troubleshoot request feedback failure [#285]
- Updated `nodemailer` to `v9.0.1` and `undici` to `v7.28.0` [#240]
- Updated `fast-xml-parser` to `v1.2.0` and `uuid` to `11.1.1` to address vulnerabilities.
- Added `@types/nodemailer` [#189]
- Added override for `lodash` to `4.18.1` to address high vulnerability issue
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `users`
ADD COLUMN `isArchived` tinyint(1) NOT NULL DEFAULT '0' AFTER `active`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE users
ADD COLUMN passwordChangedAt timestamp NULL AFTER isArchived;
15 changes: 15 additions & 0 deletions data-migrations/2026-07-24-0231-create-userToken-table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE `passwordResetTokens` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`userId` int unsigned DEFAULT NULL,
`resetPasswordToken` varchar(255) DEFAULT NULL,
`resetPasswordExpiresAt` timestamp NULL DEFAULT NULL,
`usedAt` timestamp NULL DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdById` int unsigned NOT NULL,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modifiedById` int unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_userId` (`userId`),
UNIQUE KEY `uq_resetPasswordToken` (`resetPasswordToken`),
CONSTRAINT `passwordResetTokens_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
42 changes: 42 additions & 0 deletions data-migrations/2027-07-29-0848-create-questionTags.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
-- Need to first drop table if it already exists because we have to rebuild them
DROP TABLE IF EXISTS questionTags;
DROP TABLE IF EXISTS versionedQuestionTags;


CREATE TABLE `questionTags` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`questionId` int unsigned NOT NULL,
`tagId` int unsigned NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdById` int unsigned NOT NULL,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modifiedById` int unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `questionTags_idx` (`questionId`,`tagId`),
KEY `createdById` (`createdById`),
KEY `modifiedById` (`modifiedById`),
KEY `tagId` (`tagId`),
CONSTRAINT `questiontags_ibfk_1` FOREIGN KEY (`createdById`) REFERENCES `users` (`id`),
CONSTRAINT `questiontags_ibfk_2` FOREIGN KEY (`modifiedById`) REFERENCES `users` (`id`),
CONSTRAINT `questiontags_ibfk_3` FOREIGN KEY (`questionId`) REFERENCES `questions` (`id`) ON DELETE CASCADE,
CONSTRAINT `questiontags_ibfk_4` FOREIGN KEY (`tagId`) REFERENCES `tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `versionedQuestionTags` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`versionedQuestionId` int unsigned NOT NULL,
`tagId` int unsigned NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdById` int unsigned NOT NULL,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modifiedById` int unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `versionedQuestionTags_idx` (`versionedQuestionId`,`tagId`),
KEY `createdById` (`createdById`),
KEY `modifiedById` (`modifiedById`),
KEY `tagId` (`tagId`),
CONSTRAINT `versionedquestiontags_ibfk_1` FOREIGN KEY (`createdById`) REFERENCES `users` (`id`),
CONSTRAINT `versionedquestiontags_ibfk_2` FOREIGN KEY (`modifiedById`) REFERENCES `users` (`id`),
CONSTRAINT `versionedquestiontags_ibfk_3` FOREIGN KEY (`versionedQuestionId`) REFERENCES `versionedQuestions` (`id`) ON DELETE CASCADE,
CONSTRAINT `versionedquestiontags_ibfk_4` FOREIGN KEY (`tagId`) REFERENCES `tags` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Loading