0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/schemas/alterations
wangsijie 79b49ab79a
feat(core): support more encrypt methods (#5444)
* feat(schemas): add more encryption methods

* feat(core): support more encrypt methods

* fix(schemas): fix alter down column name

* fix(core): fix tiny lint issue

* refactor(core,schemas): use uppercase value

* feat(core,schemas): add bcrypt

* fix(schemas): fix alter script

* refactor(core,schemas): rename bcrypt and use hash-wasm

* chore: fix lock file
2024-03-04 03:18:19 +00:00
..
utils feat(schemas): init org invitation tables 2024-01-11 14:38:37 +08:00
1.0.0-1677208902-update-admin-console-config.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1677765137-seed-for-admin-tenant.ts refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.0.0-1677907982-allow-admin-create-multiple-tenants.ts refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.0.0-1678157950-privacy-policy-url.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678199795-add-verification-status-table.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678259693-remove-branding-style-config.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678269972-use-restrictive-policies.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678284778-restrict-internal-roles.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678425761-m2m-app-for-tenants.ts refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.0.0-1678450233-support-custom-content.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678716747-service-logs.ts refactor(schemas,core,console): use JsonObject instead of ArbitraryObject (#3730) 2023-04-24 11:11:27 +08:00
1.0.0-1678928481-remove-deprecated-logto-config-item.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1678953179-update-get-started-task-config.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0-1679209413-drop-connector-database-storage.ts release: core v1.0.0 (#3554) 2023-03-20 23:57:04 +08:00
1.0.0_beta.10-1-logto-config.ts refactor(schemas,core,console): use JsonObject instead of ArbitraryObject (#3730) 2023-04-24 11:11:27 +08:00
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 refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.0.0_rc.1-1676115897-add-admin-tenant.ts refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.0.0_rc.1-1676185899-fix-logs-index.ts
1.0.0_rc.1-1676190092-migrate-admin-data.ts refactor: reorg packages 2023-04-04 16:28:48 +08:00
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 refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.0.0_rc.1-1676956206-move-console-sie-to-database.ts
1.0.0_rc.1-1677059985-move-console-application-to-database.ts refactor: reorg packages 2023-04-04 16:28:48 +08:00
1.2.0-1681267285-fix-get-started-passwordless-status.ts release: version packages (#3705) 2023-04-18 21:13:31 +08:00
1.3.0-1683292832-update-hooks.ts release: version packages (#3794) 2023-05-16 04:52:17 +00:00
1.5.0-1684382842-add-name-tag-created-at-for-tenants-table.ts release: version packages (#3857) 2023-06-06 23:21:29 +08:00
1.5.0-1684739802-create-hook-id-index-for-logs.ts release: version packages (#3857) 2023-06-06 23:21:29 +08:00
1.5.0-1684822341-init-domains.ts release: version packages (#3857) 2023-06-06 23:21:29 +08:00
1.5.0-1684837981-add-manage-tenant-self-scope-to-user-role.ts release: version packages (#3857) 2023-06-06 23:21:29 +08:00
1.5.0-1685285719-support-default-resource.ts release: version packages (#3857) 2023-06-06 23:21:29 +08:00
1.6.0-1685691718-domain-unique.ts release: version packages (#4033) 2023-06-28 18:57:43 +08:00
1.7.0-1688375200-sync-cloud-m2m-to-logto-config.ts release: version packages (#4255) 2023-07-31 18:43:59 +08:00
1.7.0-1688613459-remove-m2m-credentials-from-existing-logto-email-connector-config.ts release: version packages (#4255) 2023-07-31 18:43:59 +08:00
1.7.0-1688627407-daily-active-users.ts release: version packages (#4255) 2023-07-31 18:43:59 +08:00
1.8.0-1692088012-add-is-suspend-column-to-tenants-table.ts release: version packages (#4270) 2023-08-30 16:16:55 +08:00
1.8.0-1692194751-add-affiliate-scopes.ts release: version packages (#4270) 2023-08-30 16:16:55 +08:00
1.9.0-1693554904-add-possword-policy.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.0-1694399696-add-type-col-to-roles-table.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.0-1694418765-specify-check-role-type-function-to-be-public-schema.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.0-1694484927-remove-deprecated-challenge-flag.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.0-1694487524-sie-mfa.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.0-1694509714-keep-existing-password-policy.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.0-1694746763-user-verifications.ts release: version packages (#4451) 2023-09-18 10:47:19 +00:00
1.9.2-1694854226-init-sentinel.ts release: version packages (#4575) 2023-10-07 00:39:33 -05:00
1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts chore(schemas): format alteration script (#4617) 2023-10-07 06:14:58 +00:00
1.10.1-1695647183-update-private-key-type.ts release: version packages (#4624) 2023-11-03 13:14:52 +08:00
1.10.1-1696657546-organization-tables.ts release: version packages (#4624) 2023-11-03 13:14:52 +08:00
1.10.1-1697683802-add-sso-connectors-table.ts release: version packages (#4624) 2023-11-03 13:14:52 +08:00
1.10.1-1698646271-add-organization-created-flag.ts release: version packages (#4624) 2023-11-03 13:14:52 +08:00
1.10.1-1698820410-add-user-sso-identities-table.ts release: version packages (#4624) 2023-11-03 13:14:52 +08:00
1.10.1-1698910485-user-logto-data.ts release: version packages (#4624) 2023-11-03 13:14:52 +08:00
1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.ts release: version packages (#4873) 2023-11-14 19:57:42 +08:00
1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.ts release: version packages (#4873) 2023-11-14 19:57:42 +08:00
1.12.0-1700031616-update-org-role-foreign-keys.ts release: version packages (#4894) 2023-12-06 16:13:56 +08:00
1.12.0-1701054133-add-unique-constraint-to-the-sso-connector-name.ts release: version packages (#4894) 2023-12-06 16:13:56 +08:00
1.12.0-1701245520-add-single-sign-on-enabled-flag-to-sie.ts release: version packages (#4894) 2023-12-06 16:13:56 +08:00
1.13.0-1702274830-add-new-third-party-column-to-applications-table.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1702372401-add-application-permissions-tables.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1702544178-sync-tenant-orgs.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1702871078-protected-application-type.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1702877515-protected-app-configs.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1702978120-application-sign-in-experience-table.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1703229996-daily-token-usage.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1703230000-update-tenant-roles.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1704692973-remove-legacy-resources.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1704934999-add-magic-links-table.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1704935001-add-organization-invitation-tables.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1705288654-add-application-user-consent-organizations-table.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1705991158-update-invitation-indices.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1706449174-update-organization-invitation-column.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1706510290-protected-app-host-index.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1706512952-restore-get-started-page.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1706528755-remove-magic-links.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.0-1706585206-protected-app-custom-domain-unique.ts release: version packages (#5068) 2024-02-08 13:18:42 +08:00
1.13.1-1707360939-grant-is-suspended-read-permission.ts release: version packages (#5433) 2024-02-26 08:41:08 +00:00
1.14.0-1708916601-remove-management-api-scopes-assigned-to-user-role.ts release: version packages (#5445) 2024-03-01 14:40:25 +08:00
1.14.0-1709190131-enhance-dau-data-accuracy.ts release: version packages (#5445) 2024-03-01 14:40:25 +08:00
next-1709521416-user-password-encrypt-method.ts feat(core): support more encrypt methods (#5444) 2024-03-04 03:18:19 +00:00
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";
  `);
};