Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contember/schema-migrations

Package Overview
Dependencies
Maintainers
5
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/schema-migrations - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

5

dist/src/modifications/relations/UpdateRelationOnDeleteModification.js

@@ -16,7 +16,8 @@ "use strict";

createSql(builder, { databaseMetadata, invalidateDatabaseMetadata }) {
const entity = this.schema.model.entities[this.data.entityName];
const updatedSchema = this.getSchemaUpdater()({ schema: this.schema });
const entity = updatedSchema.model.entities[this.data.entityName];
if (entity.view) {
return;
}
(0, schema_utils_1.acceptRelationTypeVisitor)(this.schema.model, entity, this.data.fieldName, {
(0, schema_utils_1.acceptRelationTypeVisitor)(updatedSchema.model, entity, this.data.fieldName, {
visitManyHasOne: ({ entity, relation, targetEntity }) => {

@@ -23,0 +24,0 @@ (0, helpers_1.addForeignKeyConstraint)({ builder, entity, targetEntity, relation, recreate: true, databaseMetadata, invalidateDatabaseMetadata });

2

dist/tests/cases/integration/createRelationInverseSide.test.js

@@ -65,4 +65,4 @@ "use strict";

],
sql: (0, tags_1.SQL) `ALTER TABLE "post_locale" DROP CONSTRAINT "fk_post_locale_post_id_post_id"; ALTER TABLE "post_locale" ADD FOREIGN KEY ("post_id") REFERENCES "post"("id") ON DELETE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;`,
sql: (0, tags_1.SQL) `ALTER TABLE "post_locale" DROP CONSTRAINT "fk_post_locale_post_id_post_id"; ALTER TABLE "post_locale" ADD FOREIGN KEY ("post_id") REFERENCES "post"("id") ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE;`,
});
//# sourceMappingURL=createRelationInverseSide.test.js.map

@@ -31,4 +31,4 @@ "use strict";

sql: (0, tags_1.SQL) `ALTER TABLE "post" DROP CONSTRAINT "fk_post_category_id_category_id";
ALTER TABLE "post" ADD FOREIGN KEY ("category_id") REFERENCES "category"("id") ON DELETE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;`,
ALTER TABLE "post" ADD FOREIGN KEY ("category_id") REFERENCES "category"("id") ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE;`,
});
//# sourceMappingURL=updateRelationOnDelete.test.js.map
{
"name": "@contember/schema-migrations",
"version": "1.3.2",
"version": "1.3.3",
"license": "Apache-2.0",

@@ -15,6 +15,6 @@ "main": "dist/src/index.js",

"dependencies": {
"@contember/database-migrations": "1.3.2",
"@contember/engine-common": "1.3.2",
"@contember/schema": "1.3.2",
"@contember/schema-utils": "1.3.2",
"@contember/database-migrations": "1.3.3",
"@contember/engine-common": "1.3.3",
"@contember/schema": "1.3.3",
"@contember/schema-utils": "1.3.3",
"fast-deep-equal": "^3.1.3",

@@ -24,3 +24,3 @@ "rfc6902": "^5.0.1"

"devDependencies": {
"@contember/schema-definition": "1.3.2"
"@contember/schema-definition": "1.3.3"
},

@@ -27,0 +27,0 @@ "peerDependencies": {

@@ -22,7 +22,9 @@ import { MigrationBuilder } from '@contember/database-migrations'

public createSql(builder: MigrationBuilder, { databaseMetadata, invalidateDatabaseMetadata }: ModificationHandlerCreateSqlOptions): void {
const entity = this.schema.model.entities[this.data.entityName]
const updatedSchema = this.getSchemaUpdater()({ schema: this.schema })
const entity = updatedSchema.model.entities[this.data.entityName]
if (entity.view) {
return
}
acceptRelationTypeVisitor(this.schema.model, entity, this.data.fieldName, {
acceptRelationTypeVisitor(updatedSchema.model, entity, this.data.fieldName, {
visitManyHasOne: ({ entity, relation, targetEntity }) => {

@@ -29,0 +31,0 @@ addForeignKeyConstraint({ builder, entity, targetEntity, relation, recreate: true, databaseMetadata, invalidateDatabaseMetadata })

@@ -67,3 +67,3 @@ import { testMigrations } from '../../src/tests'

],
sql: SQL`ALTER TABLE "post_locale" DROP CONSTRAINT "fk_post_locale_post_id_post_id"; ALTER TABLE "post_locale" ADD FOREIGN KEY ("post_id") REFERENCES "post"("id") ON DELETE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;`,
sql: SQL`ALTER TABLE "post_locale" DROP CONSTRAINT "fk_post_locale_post_id_post_id"; ALTER TABLE "post_locale" ADD FOREIGN KEY ("post_id") REFERENCES "post"("id") ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE;`,
})

@@ -34,3 +34,3 @@ import { testMigrations } from '../../src/tests'

sql: SQL`ALTER TABLE "post" DROP CONSTRAINT "fk_post_category_id_category_id";
ALTER TABLE "post" ADD FOREIGN KEY ("category_id") REFERENCES "category"("id") ON DELETE NO ACTION DEFERRABLE INITIALLY IMMEDIATE;`,
ALTER TABLE "post" ADD FOREIGN KEY ("category_id") REFERENCES "category"("id") ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE;`,
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc