Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ephys authored Apr 11, 2024
2 parents f504632 + b47b4cb commit 2299862
Show file tree
Hide file tree
Showing 117 changed files with 17,036 additions and 10,564 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @sequelize/code-reviewers
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: sequelize
patreon: # Replace with a single Patreon username
open_collective: sequelize
ko_fi: # Replace with a single Ko-fi username
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: auto-update PRs & label conflicts
on:
push:
branches:
- main
# can also be used with the pull_request event
pull_request_target:
types:
- synchronize
# allow the workflow to correct any label incorrectly added or removed by a user.
- labeled
- unlabeled
# update the PR as soon as the auto-merge is enabled.
- auto_merge_enabled
# process the PR once they appear in the search filters
- ready_for_review
- opened
- reopened
jobs:
autoupdate:
runs-on: ubuntu-latest
steps:
- name: Generate Sequelize Bot Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: '${{ secrets.SEQUELIZE_BOT_APP_ID }}'
private-key: '${{ secrets.SEQUELIZE_BOT_PRIVATE_KEY }}'
- uses: sequelize/pr-auto-update-and-handle-conflicts@257ac5f68859672393e3320495164251140bd801 # 1.0.1
with:
conflict-label: 'conflicted'
conflict-requires-ready-state: 'ready_for_review'
conflict-excluded-authors: 'bot/renovate'
update-pr-branches: true
update-requires-auto-merge: true
update-requires-ready-state: 'ready_for_review'
update-excluded-authors: 'bot/renovate'
update-excluded-labels: 'no-autoupdate'
env:
GITHUB_TOKEN: '${{ steps.generate-token.outputs.token }}'
11 changes: 6 additions & 5 deletions .github/workflows/draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint-no-fix
- run: yarn lint-scss-no-fix
- run: yarn typecheck
- run: yarn sync
- run: yarn build
Expand All @@ -33,7 +34,7 @@ jobs:
shell: bash
run: |
netlify deploy --dir build --message '${{ github.event.commits[0].message }}' > log.tmp.txt 2>&1
cat log.tmp.txt | grep -E 'Logs|Website Draft URL' > log.txt
cat log.tmp.txt | grep -E 'Website draft URL:' > log.txt
- name: Read deployment log
if: '! github.event.pull_request.head.repo.fork'
id: logs
Expand All @@ -43,7 +44,7 @@ jobs:
- name: Comment PR with draft publish logs
if: '! github.event.pull_request.head.repo.fork'
id: create-comment
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20.x
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint-no-fix
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"singleQuote": true
"singleQuote": true
}
16 changes: 16 additions & 0 deletions docs/_fragments/_decorator-info.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
:::info

Sequelize currently only supports the [_legacy/experimental decorator format_](https://github.com/tc39/proposal-decorators#how-does-this-proposal-compare-to-other-versions-of-decorators).
Support for the [_new decorator format_](https://github.com/tc39/proposal-decorators) will be added in a future release.

All decorators must be imported from `@sequelize/core/decorators-legacy`:

```ts
import { Attribute, Table } from '@sequelize/core/decorators-legacy';
```

Using legacy decorators requires to use a transpiler such as [TypeScript](https://www.typescriptlang.org/docs/handbook/decorators.html#decorators),
[Babel](https://babeljs.io/docs/babel-plugin-proposal-decorators) or others to compile them to JavaScript.
Alternatively, Sequelize also supports [a legacy approach](../other-topics/legacy-model-definitions.mdx) that does not require using decorators, but this is discouraged.

:::
9 changes: 9 additions & 0 deletions docs/_fragments/_js-default-caution.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:::caution

The generation of values for `DataTypes.NOW` and other JavaScript functions are not handled by the Database,
but by Sequelize itself. This means that they will only be used when using Model methods. They will not be used in [raw queries](../querying/raw-queries.mdx),
in [migrations](../models/migrations.md), and all other places where Sequelize does not have access to the Model.

Read about SQL based alternatives in [Dynamic SQL default values](../models/defining-models.mdx#dynamic-sql-default-values).

:::
10 changes: 10 additions & 0 deletions docs/_fragments/_uuid-support-table.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { DialectTableFilter } from '@site/src/components/dialect-table-filter.tsx';

<DialectTableFilter>

| | PostgreSQL | MariaDB | MySQL | MSSQL | SQLite | Snowflake | db2 | ibmi |
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|--------|-----------|-----|------|
| `uuidV1` | [`uuid_generate_v1`](https://www.postgresql.org/docs/current/uuid-ossp.html) (requires `uuid-ossp`) | [`UUID`](https://mariadb.com/kb/en/uuid/) | [`UUID`](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid) | N/A | N/A | N/A | N/A | N/A |
| `uuidV4` | __pg >= v13__: [`gen_random_uuid`](https://www.postgresql.org/docs/current/functions-uuid.html) <br/>__pg &lt; v13__: [`uuid_generate_v4`](https://www.postgresql.org/docs/current/uuid-ossp.html) (requires `uuid-ossp`) | N/A | N/A | [`NEWID`](https://learn.microsoft.com/en-us/sql/t-sql/functions/newid-transact-sql?view=sql-server-ver16) | N/A | N/A | N/A | N/A |

</DialectTableFilter>
Loading

0 comments on commit 2299862

Please sign in to comment.