@ackplus/nest-auth 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration1746682410695 = void 0;
|
|
4
|
+
class Migration1746682410695 {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'Migration1746682410695';
|
|
7
|
+
}
|
|
8
|
+
async up(queryRunner) {
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_role_permissions" DROP CONSTRAINT "FK_e890e94238c68a858bce449faa4"`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_user_roles" DROP CONSTRAINT "FK_e960d551ae46638da46ae26bb7c"`);
|
|
11
|
+
await queryRunner.query(`CREATE TABLE "roles" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "guard" character varying DEFAULT 'web', "tenantId" uuid, "isSystem" boolean NOT NULL DEFAULT false, "isActive" boolean NOT NULL DEFAULT true, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_450582f5fcc2c778827ec2e3219" UNIQUE ("name", "guard", "tenantId"), CONSTRAINT "PK_c1433d71a4838793a49dcad46ab" PRIMARY KEY ("id"))`);
|
|
12
|
+
await queryRunner.query(`CREATE TABLE "nest_auth_access_keys" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "publicKey" character varying NOT NULL, "privateKey" character varying NOT NULL, "description" character varying, "isActive" boolean NOT NULL DEFAULT true, "expiresAt" TIMESTAMP, "lastUsedAt" TIMESTAMP, "userId" uuid NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_f5eaeb4329047e54a8d0398878a" UNIQUE ("publicKey"), CONSTRAINT "PK_c0c250ec2ad74c1957588fb2ef6" PRIMARY KEY ("id"))`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" DROP COLUMN "createdByUserId"`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" ADD "description" character varying`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" ADD "metadata" text DEFAULT '{}'`);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" ADD "isActive" boolean NOT NULL DEFAULT true`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_permissions" ADD "guard" character varying DEFAULT 'web'`);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_role_permissions" ADD CONSTRAINT "FK_e890e94238c68a858bce449faa4" FOREIGN KEY ("roleId") REFERENCES "roles"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE "roles" ADD CONSTRAINT "FK_c954ae3b1156e075ccd4e9ce3e6" FOREIGN KEY ("tenantId") REFERENCES "nest_auth_tenants"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_user_roles" ADD CONSTRAINT "FK_e960d551ae46638da46ae26bb7c" FOREIGN KEY ("roleId") REFERENCES "roles"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_access_keys" ADD CONSTRAINT "FK_5a586a6bddf6d5652be9469cb7d" FOREIGN KEY ("userId") REFERENCES "nest_auth_users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
22
|
+
}
|
|
23
|
+
async down(queryRunner) {
|
|
24
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_access_keys" DROP CONSTRAINT "FK_5a586a6bddf6d5652be9469cb7d"`);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_user_roles" DROP CONSTRAINT "FK_e960d551ae46638da46ae26bb7c"`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "roles" DROP CONSTRAINT "FK_c954ae3b1156e075ccd4e9ce3e6"`);
|
|
27
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_role_permissions" DROP CONSTRAINT "FK_e890e94238c68a858bce449faa4"`);
|
|
28
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_permissions" DROP COLUMN "guard"`);
|
|
29
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" DROP COLUMN "isActive"`);
|
|
30
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" DROP COLUMN "metadata"`);
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" DROP COLUMN "description"`);
|
|
32
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_tenants" ADD "createdByUserId" character varying`);
|
|
33
|
+
await queryRunner.query(`DROP TABLE "nest_auth_access_keys"`);
|
|
34
|
+
await queryRunner.query(`DROP TABLE "roles"`);
|
|
35
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_user_roles" ADD CONSTRAINT "FK_e960d551ae46638da46ae26bb7c" FOREIGN KEY ("roleId") REFERENCES "nest_auth_roles"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
36
|
+
await queryRunner.query(`ALTER TABLE "nest_auth_role_permissions" ADD CONSTRAINT "FK_e890e94238c68a858bce449faa4" FOREIGN KEY ("roleId") REFERENCES "nest_auth_roles"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.Migration1746682410695 = Migration1746682410695;
|
|
40
|
+
//# sourceMappingURL=1746682410695-migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1746682410695-migration.js","sourceRoot":"","sources":["../../../../../../packages/nest-auth/src/lib/migrations/1746682410695-migration.ts"],"names":[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