mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:57:53 +00:00
fix(plugin-workflow): fix migration on table prefix (#1478)
* fix(plugin-workflow): fix migration on table prefix * fix(plugin-workflow): fix migration version check * fix: ci --------- Co-authored-by: chenos <chenlinxh@gmail.com>
This commit is contained in:
parent
dcc29892e6
commit
944f327212
@ -23,6 +23,7 @@ PROXY_TARGET_URL=
|
|||||||
|
|
||||||
DB_DIALECT=sqlite
|
DB_DIALECT=sqlite
|
||||||
DB_STORAGE=storage/db/nocobase.sqlite
|
DB_STORAGE=storage/db/nocobase.sqlite
|
||||||
|
DB_TABLE_PREFIX=
|
||||||
# DB_HOST=localhost
|
# DB_HOST=localhost
|
||||||
# DB_PORT=5432
|
# DB_PORT=5432
|
||||||
# DB_DATABASE=postgres
|
# DB_DATABASE=postgres
|
||||||
|
28
.github/workflows/nocobase-test.yml
vendored
28
.github/workflows/nocobase-test.yml
vendored
@ -12,11 +12,10 @@ on:
|
|||||||
- 'packages/**'
|
- 'packages/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sqlite-test:
|
build-test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node_version: ['16', '18']
|
node_version: ['16', '18']
|
||||||
underscored: [true, false]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: node:${{ matrix.node_version }}
|
container: node:${{ matrix.node_version }}
|
||||||
steps:
|
steps:
|
||||||
@ -28,6 +27,23 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
|
|
||||||
|
sqlite-test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node_version: ['18']
|
||||||
|
underscored: [true, false]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: node:${{ matrix.node_version }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js ${{ matrix.node_version }}
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node_version }}
|
||||||
|
cache: 'yarn'
|
||||||
|
- run: yarn install
|
||||||
|
# - run: yarn build
|
||||||
- name: Test with Sqlite
|
- name: Test with Sqlite
|
||||||
run: yarn test
|
run: yarn test
|
||||||
env:
|
env:
|
||||||
@ -38,7 +54,7 @@ jobs:
|
|||||||
postgres-test:
|
postgres-test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node_version: ['16', '18']
|
node_version: ['18']
|
||||||
underscored: [true, false]
|
underscored: [true, false]
|
||||||
schema: [public, nocobase]
|
schema: [public, nocobase]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -66,7 +82,7 @@ jobs:
|
|||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- run: yarn build
|
# - run: yarn build
|
||||||
- name: Test with postgres
|
- name: Test with postgres
|
||||||
run: yarn test
|
run: yarn test
|
||||||
env:
|
env:
|
||||||
@ -82,7 +98,7 @@ jobs:
|
|||||||
mysql-test:
|
mysql-test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node_version: ['16', '18']
|
node_version: ['18']
|
||||||
underscored: [true, false]
|
underscored: [true, false]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: node:${{ matrix.node_version }}
|
container: node:${{ matrix.node_version }}
|
||||||
@ -101,7 +117,7 @@ jobs:
|
|||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- run: yarn install
|
- run: yarn install
|
||||||
- run: yarn build
|
# - run: yarn build
|
||||||
- name: Test with MySQL
|
- name: Test with MySQL
|
||||||
run: yarn test
|
run: yarn test
|
||||||
env:
|
env:
|
||||||
|
@ -4,23 +4,24 @@ import { Migration } from '@nocobase/server';
|
|||||||
|
|
||||||
export default class extends Migration {
|
export default class extends Migration {
|
||||||
async up() {
|
async up() {
|
||||||
const match = await this.app.version.satisfies('<=0.9.0-alpha.2');
|
const match = await this.app.version.satisfies('<0.9.0-alpha.3');
|
||||||
if (!match) {
|
if (!match) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { context: { sequelize, queryInterface } } = arguments[0];
|
const { context: { sequelize, queryInterface } } = arguments[0];
|
||||||
|
const { db } = this.app;
|
||||||
await sequelize.transaction(async (transaction) => {
|
await sequelize.transaction(async (transaction) => {
|
||||||
await queryInterface.changeColumn('workflows', 'config', {
|
await queryInterface.changeColumn(db.getCollection('workflows').model.getTableName(), 'config', {
|
||||||
type: DataTypes.JSON
|
type: DataTypes.JSON
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
await queryInterface.changeColumn('flow_nodes', 'config', {
|
await queryInterface.changeColumn(db.getCollection('flow_nodes').model.getTableName(), 'config', {
|
||||||
type: DataTypes.JSON
|
type: DataTypes.JSON
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
await queryInterface.changeColumn('executions', 'context', {
|
await queryInterface.changeColumn(db.getCollection('executions').model.getTableName(), 'context', {
|
||||||
type: DataTypes.JSON
|
type: DataTypes.JSON
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
await queryInterface.changeColumn('jobs', 'result', {
|
await queryInterface.changeColumn(db.getCollection('jobs').model.getTableName(), 'result', {
|
||||||
type: DataTypes.JSON
|
type: DataTypes.JSON
|
||||||
}, { transaction });
|
}, { transaction });
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user