forked from FlowiseAI/Flowise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad4a3b7
commit b4aa9dd
Showing
23 changed files
with
385 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/server/src/database/migrations/postgres/1725494523908-VariablesVisibility.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class VariablesVisibility1725494523908 implements MigrationInterface { | ||
name = 'VariablesVisibility1725494523908' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
|
||
await queryRunner.query(`ALTER TABLE "variable" ADD "userId" uuid`); | ||
await queryRunner.query(`ALTER TABLE "variable" ADD "organizationId" uuid`); | ||
await queryRunner.query(`ALTER TABLE "variable" ADD "visibility" text NOT NULL DEFAULT 'Private'`); | ||
await queryRunner.query(`ALTER TABLE "variable" ALTER COLUMN "value" DROP NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "variable" ALTER COLUMN "type" SET NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "variable" ALTER COLUMN "type" SET DEFAULT 'string'`); | ||
|
||
await queryRunner.query(`CREATE INDEX "IDX_b1d1cfdcf7ea567c336a953e2b" ON "variable" ("userId") `); | ||
await queryRunner.query(`CREATE INDEX "IDX_cb8b5ee5a4506ad331209882ef" ON "variable" ("organizationId") `); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP INDEX "public"."IDX_cb8b5ee5a4506ad331209882ef"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_b1d1cfdcf7ea567c336a953e2b"`); | ||
await queryRunner.query(`ALTER TABLE "variable" ALTER COLUMN "type" DROP DEFAULT`); | ||
await queryRunner.query(`ALTER TABLE "variable" ALTER COLUMN "type" DROP NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "variable" ALTER COLUMN "value" SET NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "variable" DROP COLUMN "visibility"`); | ||
await queryRunner.query(`ALTER TABLE "variable" DROP COLUMN "organizationId"`); | ||
await queryRunner.query(`ALTER TABLE "variable" DROP COLUMN "userId"`); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import express from 'express' | ||
import variablesController from '../../controllers/variables' | ||
import enforceAbility from '../../middlewares/authentication/enforceAbility' | ||
|
||
const router = express.Router() | ||
|
||
// CREATE | ||
router.post('/', variablesController.createVariable) | ||
router.post('/', enforceAbility('Variable'), variablesController.createVariable) | ||
|
||
// READ | ||
router.get('/', variablesController.getAllVariables) | ||
router.get('/', enforceAbility('Variable'), variablesController.getAllVariables) | ||
|
||
// UPDATE | ||
router.put(['/', '/:id'], variablesController.updateVariable) | ||
router.put(['/', '/:id'], enforceAbility('Variable'), variablesController.updateVariable) | ||
|
||
// DELETE | ||
router.delete(['/', '/:id'], variablesController.deleteVariable) | ||
router.delete(['/', '/:id'], enforceAbility('Variable'), variablesController.deleteVariable) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.