1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/src/migrations
Nuno Góis 13d02685d8
chore: db migration for integration events (#7604)
https://linear.app/unleash/issue/2-2435/create-migration-for-a-new-integration-events-table

Adds a DB migration that creates the `integration_events` table:
 - `id`: Auto-incrementing primary key;
- `integration_id`: The id of the respective integration (i.e.
integration configuration);
 - `created_at`: Date of insertion;
- `state`: Integration event state, as text. Can be anything we'd like,
but I'm thinking this will be something like:
   - Success 
   - Failed 
   - SuccessWithErrors ⚠️
- `state_details`: Expands on the previous column with more details, as
text. Examples:
   - OK. Status code: 200
   - Status code: 429 - Rate limit reached
   - No access token provided
 - `event`: The whole event object, stored as a JSON blob;
- `details`: JSON blob with details about the integration execution.
Will depend on the integration itself, but for example:
   - Webhook: Request body
- Slack App: Message text and an array with all the channels we're
posting to

I think this gives us enough flexibility to cover all present and
(possibly) future integrations, but I'd like to hear your thoughts.

I'm also really torn on what to call this table:
- `integration_events`: Consistent with the feature name. Addons are now
called integrations, so this would be consistent with the new thing;
 - `addon_events`: Consistent with the existing `addons` table.
2024-07-17 10:02:04 +01:00
..
20141020151056-initial-schema.js
20141110144153-add-description-to-features.js
20141117200435-add-parameters-template-to-strategies.js
20141117202209-insert-default-strategy.js
20141118071458-default-strategy-event.js
20141215210141-005-archived-flag-to-features.js
20150210152531-006-rename-eventtype.js
20160618193924-add-strategies-to-features.js
20161027134128-create-metrics.js
20161104074441-create-client-instances.js
20161205203516-create-client-applications.js
20161212101749-better-strategy-parameter-definitions.js
20170211085502-built-in-strategies.js
20170211090541-add-default-strategies.js
20170306233934-timestamp-with-tz.js
20170628205541-add-sdk-version-to-client-instances.js
20190123204125-add-variants-to-features.js
20191023184858-flexible-rollout-strategy.js
20200102184820-create-context-fields.js
20200227202711-settings.js
20200329191251-settings-secret.js
20200416201319-create-users.js
20200429175747-users-settings.js
20200805091409-add-feature-toggle-type.js
20200805094311-add-feature-type-to-features.js
20200806091734-add-stale-flag-to-features.js
20200810200901-add-created-at-to-feature-types.js
20200928194947-add-projects.js
20200928195238-add-project-id-to-features.js
20201216140726-add-last-seen-to-features.js
20210105083014-add-tag-and-tag-types.js
20210119084617-add-addon-table.js
20210121115438-add-deprecated-column-to-strategies.js
20210127094440-add-tags-column-to-events.js
20210208203708-add-stickiness-to-context.js
20210212114759-add-session-table.js
20210217195834-rbac-tables.js
20210218090213-generate-server-identifier.js
20210302080040-add-pk-to-client-instances.js
20210304115810-change-default-timestamp-to-now.js
20210304141005-add-announce-field-to-application.js
20210304150739-add-created-by-to-application.js
20210322104356-api-tokens-table.js
20210322104357-api-tokens-convert-enterprise.js
20210323073508-reset-application-announcements.js
20210409120136-create-reset-token-table.js
20210414141220-fix-misspellings-in-role-descriptions.js
20210415173116-rbac-rename-roles.js
20210421133845-add-sort-order-to-strategies.js
20210421135405-add-display-name-and-update-description-for-strategies.js
20210423103647-lowercase-all-emails.js
20210428062103-user-permission-to-rbac.js
20210428103922-patch-role-table.js
20210428103923-onboard-projects-to-rbac.js
20210428103924-patch-admin_role.js
20210428103924-patch-admin-role-name.js
20210428103924-patch-role_permissions.js
20210504101429-deprecate-strategies.js
20210520171325-update-role-descriptions.js
20210602115555-create-feedback-table.js
20210610085817-features-strategies-table.js
20210615115226-migrate-strategies-to-feature-strategies.js
20210618091331-project-environments-table.js
20210618100913-add-cascade-for-user-feedback.js
20210624114602-change-type-of-feature-archived.js
20210624114855-drop-strategies-column-from-features.js
20210624115109-drop-enabled-column-from-features.js
20210625102126-connect-default-project-to-global-environment.js
20210629130734-add-health-rating-to-project.js
20210830113948-connect-projects-to-global-envrionments.js
20210831072631-add-sort-order-and-type-to-env.js
20210907124058-add-dbcritic-indices.js
20210907124850-add-dbcritic-primary-keys.js
20210908100701-add-enabled-to-environments.js
20210909085651-add-protected-field-to-environments.js
20210913103159-api-keys-scoping.js
20210915122001-add-project-and-environment-columns-to-events.js
20210920104218-rename-global-env-to-default-env.js
20210921105032-client-api-tokens-default.js
20210922084509-add-non-null-constraint-to-environment-type.js
20210922120521-add-tag-type-permission.js
20210928065411-remove-displayname-from-environments.js
20210928080601-add-development-and-production-environments.js
20210928082228-connect-default-environment-to-all-existing-projects.js
20211004104917-client-metrics-env.js
20211011094226-add-environment-to-client-instances.js
20211013093114-feature-strategies-parameters-not-null.js
20211029094324-set-sort-order-env.js
20211105104316-add-feature-name-column-to-events.js
20211105105509-add-predata-column-to-events.js
20211108130333-create-user-splash-table.js
20211109103930-add-splash-entry-for-users.js
20211126112551-disable-default-environment.js
20211130142314-add-updated-at-to-projects.js
20211202120808-add-custom-roles.js
20211209205201-drop-client-metrics.js
20220103134659-add-permissions-to-project-roles.js
20220103143843-add-permissions-to-editor-role.js
20220111112804-update-permission-descriptions.js
20220111115613-move-feature-toggle-permission.js
20220111120346-roles-unique-name.js
20220111121010-update-project-for-editor-role.js
20220111125620-role-permission-empty-string-for-non-environment-type.js
20220119182603-update-toggle-types-description.js
20220125200908-convert-old-feature-events.js
20220128081242-add-impressiondata-to-features.js
20220129113106-metrics-counters-as-bigint.js
20220131082150-reset-feedback-form.js
20220224081422-remove-project-column-from-roles.js
20220224111626-add-current-time-context-field.js
20220307130902-add-segments.js
20220331085057-add-api-link-table.js
20220405103233-add-segments-name-index.js
20220408081222-clean-up-duplicate-foreign-key-role-permission.js
20220411103724-add-legal-value-description.js
20220425090847-add-token-permission.js
20220511111823-patch-broken-feature-strategies.js
20220511124923-fix-patch-broken-feature-strategies.js
20220528143630-dont-cascade-environment-deletion-to-apitokens.js
20220603081324-add-archive-at-to-feature-toggle.js
20220704115624-add-user-groups.js
20220711084613-add-projects-and-environments-for-addons.js
20220808084524-add-group-permissions.js
20220808110415-add-projects-foreign-key.js
20220816121136-add-metadata-to-api-keys.js
20220817130250-alter-api-tokens.js
20220908093515-add-public-signup-tokens.js
20220912165344-pat-tokens.js
20220916093515-add-url-to-public-signup-tokens.js
20220927110212-add-enabled-to-public-signup-tokens.js
20221010114644-pat-auto-increment.js
20221011155007-add-user-groups-mappings.js
20221103111940-fix-migrations.js
20221103112200-change-request.js
20221103125732-change-request-remove-unique.js
20221104123349-change-request-approval.js
20221107121635-move-variants-to-per-environment.js
20221107132528-change-request-project-options.js
20221108114358-add-change-request-permissions.js
20221110104933-add-change-request-settings.js
20221110144113-revert-change-request-project-options.js
20221114150559-change-request-comments.js
20221115072335-add-required-approvals.js
20221121114357-add-permission-for-environment-variants.js
20221121133546-soft-delete-user.js
20221124123914-add-favorites.js
20221125185244-change-request-unique-approvals.js
20221128165141-change-request-min-approvals.js
20221205122253-skip-change-request.js
20221220160345-user-pat-permissions.js
20221221144132-service-account-users.js
20230125065315-project-stats-table.js
20230127111638-new-project-stats-field.js
20230130113337-revert-user-pat-permissions.js
20230208084046-project-api-token-permissions.js
20230208093627-assign-project-api-token-permissions-editor.js
20230208093750-assign-project-api-token-permissions-owner.js
20230208093942-assign-project-api-token-permissions-member.js
20230222084211-add-login-events-table.js
20230222154915-create-notiications-table.js
20230224093446-drop-createdBy-from-notifications-table.js
20230227115320-rename-login-events-table-to-sign-on-log.js
20230227120500-change-display-name-for-variants-per-env-permission.js
20230227123106-add-setting-for-sign-on-log-retention.js
20230302133740-rename-sign-on-log-table-to-login-history.js
20230306103400-add-project-column-to-segments.js
20230306103400-remove-direct-link-from-segment-permissions-to-admin.js
20230309174400-add-project-segment-permission.js
20230314131041-project-settings.js
20230316092547-remove-project-stats-column.js
20230411085947-skip-change-request-ui.js
20230412062635-add-change-request-title.js
20230412125618-add-title-to-strategy.js
20230414105818-add-root-role-to-groups.js
20230419104126-add-disabled-field-to-feature-strategy.js
20230420125500-v5-strategy-changes.js
20230420211308-update-context-fields-add-sessionId.js
20230424090942-project-default-strategy-settings.js
20230504145945-variant-metrics.js
20230510113903-fix-api-token-username-migration.js
20230615122909-fix-env-sort-order.js
20230619105029-new-fine-grained-api-token-permissions.js
20230619110243-assign-apitoken-permissions-to-rootroles.js
20230621141239-refactor-api-token-permissions.js
20230630080126-delete-deprecated-permissions.js
20230706123907-events-announced-column.js
20230711094214-add-potentially-stale-flag.js
20230711163311-project-feature-limit.js
20230712091834-strategy-variants.js
20230802092725-add-last-seen-column-to-feature-environments.js
20230802141830-add-feature-and-environment-last-seen-at-to-features-view.js
20230803061359-change-request-optional-feature.js
20230808104232-update-root-roles-descriptions.js
20230814095253-change-request-rejections.js
20230814115436-change-request-timzone-timestamps.js
20230815065908-change-request-approve-reject-permission.js
20230817095805-client-applications-usage-table.js
20230818124614-update-client-applications-usage-table.js
20230830121352-update-client-applications-usage-table.js
20230905122605-add-feature-naming-description.js
20230919104006-dependent-features.js
20230927071830-reset-pnps-feedback.js
20230927172930-events-announced-index.js
20231002122426-update-dependency-permission.js
20231003113443-last-seen-at-metrics-table.js
20231004120900-create-changes-stats-table-and-trigger.js fix: make sure we are still pg10 compatible. (#5214) 2023-10-30 13:19:57 +01:00
20231012082537-message-banners.js
20231019110154-rename-message-banners-table-to-banners.js
20231024121307-add-change-request-schedule.js
20231025093422-default-project-mode.js
20231030091931-add-created-by-and-status-change-request-schedule.js feat: add created_by and status columns to change_request_schedule (#5203) 2023-10-30 12:01:06 +02:00
20231103064746-change-request-schedule-change-type.js chore: remove enum type from db (#5254) 2023-11-03 09:28:19 +02:00
20231121153304-add-permission-create-tag-type.js feat: add CREATE_TAG_TYPE permission (#5386) 2023-11-22 10:20:19 +00:00
20231122121456-dedupe-any-duplicate-permissions.js fix: dedupe any duplicate permissions (#5397) 2023-11-23 10:23:21 +00:00
20231123100052-drop-last-seen-foreign-key.js Fix/clean last seen environments (#5402) 2023-11-23 12:12:58 +01:00
20231123155649-favor-permission-name-over-id.js refactor: favor permission name over id (#5409) 2023-11-27 11:12:09 +00:00
20231211121444-features-created-by.js chore: migration for features created by (#5593) 2023-12-11 14:58:23 +01:00
20231211122322-feature-types-created-by.js chore: add migration for adding created_by to feature_types table (#5591) 2023-12-11 14:57:58 +01:00
20231211122351-feature-tag-created-by.js chore: add migration for adding created_by to feature_tag table (#5590) 2023-12-11 14:57:40 +01:00
20231211122426-feature-strategies-created-by.js chore: add migration for adding created_by to feature_strategies table (#5589) 2023-12-11 14:57:18 +01:00
20231211132341-add-created-by-to-role-permission.js feat: add created_by to role_permission table (#5592) 2023-12-11 15:39:44 +01:00
20231211133008-add-created-by-to-role-user.js feat: add column created_by to role_user table (#5594) 2023-12-11 15:40:02 +01:00
20231211133920-add-created-by-to-roles.js feat: add column created_by to roles table (#5595) 2023-12-11 15:40:17 +01:00
20231211134130-add-created-by-to-users.js feat: add column created_by to users table (#5597) 2023-12-11 15:39:07 +01:00
20231211134633-add-created-by-to-apitokens.js feat: add created_by to api_tokens table (#5596) 2023-12-11 15:41:36 +01:00
20231212094044-event-created-by-user-id.js chore: add created by user id to events (#5621) 2023-12-12 15:57:59 +01:00
20231213111906-add-reason-to-change-request-schedule.js feat: add reason column to change_request_schedule (#5631) 2023-12-13 14:07:02 +02:00
20231215105713-incoming-webhooks.js chore: incoming webhooks and tokens migration (#5670) 2023-12-18 13:22:28 +00:00
20231218165612-inc-webhook-tokens-rename-secret-to-token.js chore: rename secret to token in incoming_webhook_tokens (#5679) 2023-12-18 17:11:59 +00:00
20231219100343-rename-new-columns-to-created-by-user-id.js chore: add migration that renames new created_by columns (#5681) 2023-12-19 13:14:15 +01:00
20231221143955-feedback-table.js feat: feedback table (#5721) 2023-12-21 15:34:35 +02:00
20231222071533-unleash-system-user.js chore:system user and events created by userid migrations (#5612) 2023-12-22 11:19:39 +01:00
20240102142100-incoming-webhooks-created-by.js feat: support null created_by_user_id (#5744) 2024-01-02 17:53:29 +01:00
20240102205517-observable-events.js chore: observable events db migration (#5749) 2024-01-03 12:08:14 +00:00
20240108151652-add-daily-metrics.js feat: daily metrics db migration (#5791) 2024-01-09 11:56:12 +01:00
20240109093021-incoming-webhooks-description.js chore: incoming webhooks description migration (#5803) 2024-01-09 10:39:51 +00:00
20240109095348-add-reason-column-to-schedule.js chore: add reason column to change request schedule table (#5802) 2024-01-10 08:47:30 +05:30
20240111075911-update-system-user-email.js chore: remove system user's email in db. (#5849) 2024-01-16 11:15:29 +05:30
20240111125100-automated-actions.js feat: add automated actions tables (#5857) 2024-01-11 14:42:37 +01:00
20240116104456-drop-unused-column-permissionid.js chore: delete unnecessary column permission_id (#5413) 2024-01-16 10:56:22 +00:00
20240116154700-unleash-admin-token-user.js chore: add another system user for admin tokens (#5915) 2024-01-16 19:28:36 +01:00
20240117093601-add-more-granular-project-permissions.js feat: added more granular project permissions (#5932) 2024-01-18 09:57:44 +01:00
20240118093611-missing-primary-keys.js feat: add primary keys to missing tables (#5943) 2024-01-18 13:52:51 +02:00
20240119171200-action-states.js feat: add action states (#5983) 2024-01-22 11:49:35 +01:00
20240124123000-add-enabled-to-action-sets.js feat(2-1879): add enabled to action sets (#6023) 2024-01-24 12:52:04 +01:00
20240125084701-add-user-trends.js feat: user trends migration (#6030) 2024-01-25 12:56:29 +01:00
20240125085703-users-table-increae-image-url-size.js chore: change users image_url column to text (#6031) 2024-01-25 11:40:18 +02:00
20240125090553-events-fix-incorrectly-assigned-sysuser-id.js chore: add a migration that removes incorrectly set sysuserid (#6032) 2024-01-29 09:16:18 +01:00
20240125100000-events-system-user-old2new.js chore: replace systemUser -1 with new -1337 system user (#5999) 2024-01-25 11:19:39 +01:00
20240126095544-add-flag-trends.js feat: flag trends db migration (#6044) 2024-01-26 14:37:15 +01:00
20240130104757-flag-trends-health-time-to-production.js feat: migration for health and time_to_production in flag trends (#6067) 2024-01-30 13:28:10 +01:00
20240207164033-client-applications-announced-index.js feat: add partial index on client_applications annouced FALSE (#6166) 2024-02-08 10:57:10 +02:00
20240208123212-create-stat-traffic-usage-table.js chore: add migration for traffic data collection (#6171) 2024-02-09 09:58:58 +01:00
20240208130439-events-revision-id-index.js feat: add index on events for faster revision id (#6170) 2024-02-08 14:11:58 +02:00
20240215133213-flag-trends-users.js migration: flag-trends - add users column (#6254) 2024-02-16 15:42:47 +01:00
20240220130622-add-action-state-indexes.js chore: add action state db indexes (#6283) 2024-02-20 15:45:33 +00:00
20240221082758-action-events.js chore: action_set_events db table migration (#6298) 2024-02-21 14:02:19 +00:00
20240221115502-drop-action-states.js chore: db drop action_states (#6300) 2024-02-21 17:32:08 +00:00
20240222123532-project-metrics-summary-trends.js fix: project client metrics trends remove invalid insert (#6385) 2024-02-29 09:52:58 +01:00
20240229093231-drop-fk-and-cascade-in-trends.js fix: relax trends tables constraints (#6386) 2024-02-29 10:56:14 +01:00
20240304084102-rename-observable-events-to-signals.js chore: rename incoming webhooks to signals (DB) (#6413) 2024-03-04 10:28:19 +00:00
20240304160659-add-environment-type-trends.js Feat: add enviroment type trends table (#6432) 2024-03-05 10:51:32 +02:00
20240305094305-features-remove-archived.js chore: remove archived column from features table (#6431) 2024-03-05 22:28:47 +02:00
20240305121426-add-created-at-environment-type-trends.js Fix: add created at to environment type trends (#6437) 2024-03-05 15:10:13 +02:00
20240305121702-add-metrics-summary-columns-to-flag-trends.js Feat: add metrics summary columns to flag trends (#6440) 2024-03-05 16:49:17 +02:00
20240305131822-add-scim-id-column-to-user.js fix: scim id was not unique (#6450) 2024-03-12 13:36:21 +01:00
20240306145609-make-scim-id-idx-unique.js fix: scim id was not unique (#6450) 2024-03-12 13:36:21 +01:00
20240325081847-add-scim-id-for-groups.js chore: add scim id migration for groups (#6682) 2024-03-25 11:39:11 +02:00
20240326122126-add-index-on-group-name.js feat: add index on group name (#6696) 2024-03-26 14:48:05 +01:00
20240329064629-revert-feature-archived.js fix: revert archived column for backwards migration compatibility (#6737) 2024-03-29 13:00:33 +01:00
20240405120422-add-feature-lifecycles.js feat: Feature lifecycle sql store (#6790) 2024-04-08 08:54:41 +02:00
20240405174629-jobs.js feat: allow schedulers to run in a single node (#6794) 2024-04-10 11:47:22 +02:00
20240408104624-fix-environment-type-trends.js fix: environment_type_trends table data (#6796) 2024-04-09 12:37:05 +03:00
20240418140646-add-ip-column-to-events-table.js feat: use audit info in events (#6872) 2024-04-18 16:32:35 +02:00
20240425132155-flag-trends-bigint.js fix: flag trends should support bigint for yes and no evaluations (#6930) 2024-04-25 14:02:04 +03:00
20240430075605-add-scim-external-id.js task: added migration for scim_external_id (#6966) 2024-04-30 10:24:17 +02:00
20240506141345-lifecycle-initial-stage.js feat: create initial stages for features (#6983) 2024-05-07 11:38:51 +03:00
20240507075431-client-metrics-env-daily-bigint.js feat: increase possible number range for yes/no metrics (#6995) 2024-05-07 13:54:56 +02:00
20240508153244-feature-lifecycles-status.js feat: add status fields for feature lifecycle table (#7014) 2024-05-09 09:39:01 +03:00
20240523093355-toggle-to-flag-rename.js feat: rename toggle to flag with db migration (#7118) 2024-05-23 10:17:02 +03:00
20240523113322-roles-toggle-to-flag-rename.js chore: rename roles toggles to flag (#7123) 2024-05-23 12:01:04 +03:00
20240611092538-add-created-by-to-features-view.js feat: adding full creator information to view used by feature read (#7356) 2024-06-11 14:19:32 +02:00
20240705111827-used-passwords-table.js feat: Disallow repeating last 5 passwords. (#7552) 2024-07-09 16:18:35 +02:00
20240716135038-integration-events.js chore: db migration for integration events (#7604) 2024-07-17 10:02:04 +01:00
default-strategies.json
flexible-rollout-strategy.json