0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/schemas/alterations
Charles Zhao ce3a62bc7a
feat(core,schemas): add post custom ui assets api (#6118)
* feat(core,schemas): add post custom ui assets api
2024-07-15 16:06:09 +00:00
..
utils
1.0.0-1677208902-update-admin-console-config.ts
1.0.0-1677765137-seed-for-admin-tenant.ts
1.0.0-1677907982-allow-admin-create-multiple-tenants.ts
1.0.0-1678157950-privacy-policy-url.ts
1.0.0-1678199795-add-verification-status-table.ts
1.0.0-1678259693-remove-branding-style-config.ts
1.0.0-1678269972-use-restrictive-policies.ts
1.0.0-1678284778-restrict-internal-roles.ts
1.0.0-1678425761-m2m-app-for-tenants.ts
1.0.0-1678450233-support-custom-content.ts
1.0.0-1678716747-service-logs.ts
1.0.0-1678928481-remove-deprecated-logto-config-item.ts
1.0.0-1678953179-update-get-started-task-config.ts
1.0.0-1679209413-drop-connector-database-storage.ts
1.0.0_beta.10-1-logto-config.ts
1.0.0_beta.10-1663923211-machine-to-machine-app.ts
1.0.0_beta.10-1664265197-custom-phrases.ts
1.0.0_beta.11-1664347703-rename-language-key-to-tag.ts
1.0.0_beta.11-1664356000-add-created-at-column-to-users.ts
1.0.0_beta.11-1664462389-correct-user-created-at-column-by-user-logs.ts
1.0.0_beta.14-1665300135-sign-in-sign-up.ts
1.0.0_beta.14-1667283640-remove-forgot-password.ts
1.0.0_beta.14-1667292082-remove-sign-in-method.ts
1.0.0_beta.14-1667374974-user-suspend.ts
1.0.0_beta.14-1667900481-add-passcode-type-continue.ts
1.0.0_beta.18-1668666590-support-multiple-connector-instances.ts
1.0.0_beta.18-1668666600-remove-connector-enabled.ts
1.0.0_beta.18-1669091623-roles-and-scopes.ts
1.0.0_beta.18-1669702299-sign-up.ts
1.0.0_beta.18-1671039448-add-user-name-index.ts
1.0.0_beta.18-1671080370-terms-of-use.ts
1.0.0_beta.18-1671336831-refactor-log-types.ts
1.0.0_beta.18-1671509870-hooks.ts
1.0.0_beta.18-1672119200-align-passcode-type-with-message-type.ts
1.0.0_rc.0-1672815959-user-roles.ts
1.0.0_rc.0-1672820345-scope-resource-id.ts
1.0.0_rc.0-1672901841-roles-and-scopes-not-null.ts
1.0.0_rc.0-1673001922-support-generic-passcode.ts
1.0.0_rc.0-1673165463-scope-name-index.ts
1.0.0_rc.0-1673349501-sms-sign-in-identifier-to-phone.ts
1.0.0_rc.0-1673465463-ac-scope-name.ts
1.0.0_rc.0-1673853579-ac-default-scope.ts
1.0.0_rc.0-1673863835-ac-scope-role.ts
1.0.0_rc.0-1673882867-fix-alteration-issues.ts
1.0.0_rc.0-1673940577-scope-description-not-null.ts
1.0.0_rc.0-1673941897-application-roles.ts
1.0.0_rc.0-1674032095.1-dedup-resources-constraint.ts
1.0.0_rc.0-1674032095.2-oidc-model-pkey.ts
1.0.0_rc.0-1674032095.3-tenant-table.ts
1.0.0_rc.0-1674032095.4-add-id-column.ts
1.0.0_rc.0-1674032095.5-multi-tenancy.ts
1.0.0_rc.0-1674032095.6-add-tenant-id-trigger.ts
1.0.0_rc.0-1674987042-drop-settings-and-create-systems.ts
1.0.0_rc.0-1675316731-update-seed-data.ts
1.0.0_rc.1-1675788753-multi-tenancy-rls.ts
1.0.0_rc.1-1676115897-add-admin-tenant.ts
1.0.0_rc.1-1676185899-fix-logs-index.ts
1.0.0_rc.1-1676190092-migrate-admin-data.ts
1.0.0_rc.1-1676823841-update-sie-primary-key.ts
1.0.0_rc.1-1676874936-support-custom-css.ts
1.0.0_rc.1-1676886855-connector-database-read-write.ts
1.0.0_rc.1-1676906977-remove-demo-app.ts
1.0.0_rc.1-1676956206-move-console-sie-to-database.ts
1.0.0_rc.1-1677059985-move-console-application-to-database.ts
1.2.0-1681267285-fix-get-started-passwordless-status.ts
1.3.0-1683292832-update-hooks.ts
1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.ts
1.5.0-1684739802-create-hook-id-index-for-logs.ts
1.5.0-1684822341-init-domains.ts
1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.ts
1.5.0-1685285719-support-default-resource.ts
1.6.0-1685691718-domain-unique.ts
1.7.0-1688375200-sync-cloud-m2m-to-logto-config.ts
1.7.0-1688613459-remove-m2m-credentials-from-existing-logto-email-connector-config.ts
1.7.0-1688627407-daily-active-users.ts
1.8.0-1692088012-add-is-suspend-column-to-tenants-table.ts
1.8.0-1692194751-add-affiliate-scopes.ts
1.9.0-1693554904-add-possword-policy.ts
1.9.0-1694399696-add-type-col-to-roles-table.ts
1.9.0-1694418765-specify-check-role-type-function-to-be-public-schema.ts
1.9.0-1694484927-remove-deprecated-challenge-flag.ts
1.9.0-1694487524-sie-mfa.ts
1.9.0-1694509714-keep-existing-password-policy.ts
1.9.0-1694746763-user-verifications.ts
1.9.2-1694854226-init-sentinel.ts
1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts
1.10.1-1695647183-update-private-key-type.ts
1.10.1-1696657546-organization-tables.ts
1.10.1-1697683802-add-sso-connectors-table.ts
1.10.1-1698646271-add-organization-created-flag.ts
1.10.1-1698820410-add-user-sso-identities-table.ts
1.10.1-1698910485-user-logto-data.ts
1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.ts
1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.ts
1.12.0-1700031616-update-org-role-foreign-keys.ts
1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.ts
1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.ts
1.13.0-1702274830-add-new-third-party-column-to-applications-table.ts
1.13.0-1702372401-add-application-permissions-tables.ts
1.13.0-1702544178-sync-tenant-orgs.ts
1.13.0-1702871078-protected-application-type.ts
1.13.0-1702877515-protected-app-configs.ts
1.13.0-1702978120-application-sign-in-experience-table.ts
1.13.0-1703229996-daily-token-usage.ts
1.13.0-1703230000-update-tenant-roles.ts
1.13.0-1704692973-remove-legacy-resources.ts
1.13.0-1704934999-add-magic-links-table.ts
1.13.0-1704935001-add-organization-invitation-tables.ts
1.13.0-1705288654-add-application-user-consent-organizations-table.ts
1.13.0-1705991158-update-invitation-indices.ts
1.13.0-1706449174-update-organization-invitation-column.ts
1.13.0-1706510290-protected-app-host-index.ts
1.13.0-1706512952-restore-get-started-page.ts
1.13.0-1706528755-remove-magic-links.ts
1.13.0-1706585206-protected-app-custom-domain-unique.ts
1.13.1-1707360939-grant-is-suspended-read-permission.ts
1.14.0-1708916601-remove-management-api-scopes-assigned-to-user-role.ts
1.14.0-1709190131-enhance-dau-data-accuracy.ts
1.15.0-1709521416-user-password-encrypt-method.ts
1.15.0-1709528944-regenerate-dau-data.ts
1.15.0-1710223946-add-fetch-custom-jwt-cloud-scope.ts
1.15.0-1710408335-make-resource-scopes-description-nullable.ts
1.15.0-1710859622-add-oidc-standard-claim-properties.ts
1.15.0-1711607772-remove-invite-member-scope-from-tenant-member-role.ts
1.15.0-1711624564-add-read-member-scope-to-tenant-roles.ts
1.15.0-1711955211-organization-resource-scope.ts
1.15.0-1712041436-rename-organization-member-role-to-collaborator.ts
1.15.0-1712545011-fix-organization-resource-scope.ts
1.15.0-1712559358-fix-down-organization-resource-scope.ts
1.16.0-1712912361-delete-jwt-customier-with-empty-script.ts
1.16.0-1713942039-add-organization-custom-data.ts
1.16.0-1714270244-application-org-resource-scope.ts
1.17.0-1715826336-add-default-user-role-config.ts
1.17.0-1715829731-rename-data-hook-schema-update-event.ts
1.17.0-1716278409-remove-internal-role-database-policies.ts
1.17.0-1716291265-create-pre-configured-m-api-role.ts
1.17.0-1717148078-remove-service-log-reference.ts
1.18.0-1717567857-social-sign-in-linking.ts
1.18.0-1717597875-add-organization-email-domains-table.ts
1.18.0-1717818597-organization-mfa-requirement.ts
1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.ts
1.18.0-1718594164-add-agree-to-terms-policy.ts
1.18.0-1718785576-organization-application-relations.ts
1.18.0-1718786576-organization-jit-sso-connectors.ts
1.18.0-1718807616-organization-role-application-relations.ts
1.18.0-1718865814-add-subject-tokens.ts
1.18.0-1719014832-organization-role-types.ts
1.18.0-1719221205-fix-functions.ts
1.18.0-1719312694-custom-ui-assets.ts
next-1720253939-add-organization-branding.ts
next-1720345784-add-color-to-app-sie.ts
next-1720505152-update-custom-ui-assets.ts
README.md

Database alteration

The folder for all alteration files.

Format

The alteration files are named in the format of <version>-<timestamp>-name.js where <timestamp> is the unix timestamp of when the alteration was created and name is the name of the alteration, version is this npm package's version number.

As for development, the version is "next" until the package is released.

Note that, you SHOULD NOT change the content of the alteration files after they are created. If you need to change the alteration, you should create a new alteration file with the new content.

Deploy unreleased alterations

To deploy scripts with the next version, run pnpm alteration deploy next. This is helpful if you want to test your alteration scripts.

Typing

type AlterationScript = {
  up: (connection: DatabaseTransactionConnection) => Promise<void>;
  down: (connection: DatabaseTransactionConnection) => Promise<void>;
};

When the alteration script is executed, the up function is called to alter the database schema.

The down function is designed for the future downgrade feature.

Example

export const up = async (connection) => {
  await connection.query(`
    alter table "user"
    add column "email" varchar(255) not null;
  `);
};

export const down = async (connection) => {
  await connection.query(`
    alter table "user"
    drop column "email";
  `);
};