Repository: ariga/atlas
Pull request #1617 (2023-05-01 13:39:10)

sql/schema: add diff options to allow skip changes by their type


Patch:
diff --git a/cmd/atlas/go.mod b/cmd/atlas/go.mod
index a4533bf7..5fde310a 100644
--- a/cmd/atlas/go.mod
+++ b/cmd/atlas/go.mod
@@ -3,8 +3,8 @@ module ariga.io/atlas/cmd/atlas
 go 1.20
 
 require (
-	ariga.io/atlas v0.10.1-0.20230404183748-023b08ad359c
-	entgo.io/ent v0.12.1
+	ariga.io/atlas v0.10.2-0.20230427182402-87a07dfb83bf
+	entgo.io/ent v0.12.3
 	github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220816024939-bc8df83d7b9d
 	github.com/auxten/postgresql-parser v1.0.1
 	github.com/fatih/color v1.13.0
@@ -24,7 +24,7 @@ require (
 	github.com/zclconf/go-cty v1.8.0
 	gocloud.dev v0.27.0
 	golang.org/x/exp v0.0.0-20220428152302-39d4317da171
-	golang.org/x/mod v0.8.0
+	golang.org/x/mod v0.10.0
 )
 
 require (
@@ -88,12 +88,12 @@ require (
 	go.uber.org/atomic v1.9.0 // indirect
 	go.uber.org/multierr v1.8.0 // indirect
 	go.uber.org/zap v1.21.0 // indirect
-	golang.org/x/net v0.8.0 // indirect
+	golang.org/x/net v0.9.0 // indirect
 	golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
 	golang.org/x/sync v0.1.0 // indirect
-	golang.org/x/sys v0.6.0 // indirect
-	golang.org/x/text v0.8.0 // indirect
-	golang.org/x/tools v0.6.1-0.20230222164832-25d2519c8696 // indirect
+	golang.org/x/sys v0.7.0 // indirect
+	golang.org/x/text v0.9.0 // indirect
+	golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901 // indirect
 	golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
 	google.golang.org/api v0.91.0 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
diff --git a/cmd/atlas/go.sum b/cmd/atlas/go.sum
index 832b6194..8aa82a0c 100644
--- a/cmd/atlas/go.sum
+++ b/cmd/atlas/go.sum
@@ -1,5 +1,6 @@
 ariga.io/atlas v0.10.1-0.20230404183748-023b08ad359c h1:epJteUhqSlck4GMjBEr3wORNqg2h51zhiA+SedIS5o4=
 ariga.io/atlas v0.10.1-0.20230404183748-023b08ad359c/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk=
+ariga.io/atlas v0.10.2-0.20230427182402-87a07dfb83bf/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk=
 bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
 bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
@@ -85,6 +86,8 @@ contrib.go.opencensus.io/integrations/ocsql v0.1.7/go.mod h1:8DsSdjz3F+APR+0z0Wk
 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 entgo.io/ent v0.12.1 h1:bqK+WMwfjpTsFiXx9tQSEZMNLyAADSx5Y1xySjT4Tm8=
 entgo.io/ent v0.12.1/go.mod h1:OA1Y5bNE8EtlxKv4IyzWwt4jgvGbkoKMcwp668iEKQE=
+entgo.io/ent v0.12.3 h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk=
+entgo.io/ent v0.12.3/go.mod h1:AigGGx+tbrBBYHAzGOg8ND661E5cxx1Uiu5o/otJ6Yg=
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg=
 github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
 github.com/Azure/azure-amqp-common-go/v3 v3.2.3/go.mod h1:7rPmbSfszeovxGfc5fSAXE4ehlXQZHpMja2OtxC2Tas=
@@ -1673,6 +1676,7 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1752,6 +1756,7 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug
 golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
 golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
 golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1937,6 +1942,7 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -1953,6 +1959,7 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
 golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -2051,6 +2058,7 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E
 golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
 golang.org/x/tools v0.6.1-0.20230222164832-25d2519c8696 h1:8985/C5IvACpd9DDXckSnjSBLKDgbxXiyODgi94zOPM=
 golang.org/x/tools v0.6.1-0.20230222164832-25d2519c8696/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
+golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
 golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/cmd/atlas/go.work.sum b/cmd/atlas/go.work.sum
index 3ad7fbb7..210b68fe 100644
--- a/cmd/atlas/go.work.sum
+++ b/cmd/atlas/go.work.sum
@@ -513,7 +513,6 @@ github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
 github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
 github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
 github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
 github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
 github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M=
 github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM=
@@ -601,12 +600,17 @@ golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCoj
 golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
 golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
+golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
 golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=
 golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
 golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ=
 golang.org/x/tools v0.3.1-0.20221118185510-36a5c6a8a6d3 h1:UMw8OcMiGbjUlB+MOuc7KLpXjCA9oX4NNAU+A5sgKlQ=
+golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901 h1:0wxTF6pSjIIhNt7mo9GvjDfzyCOiWhmICgtO/Ah948s=
 google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
 google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8 h1:Cpp2P6TPjujNoC5M2KHY6g7wfyLYfIWRZaSdIKfDasA=
 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE=
diff --git a/doc/md/deployment/cloud-sql-via-github-actions.md b/doc/md/guides/deploying/cloud-sql-via-github-actions.md
similarity index 99%
rename from doc/md/deployment/cloud-sql-via-github-actions.md
rename to doc/md/guides/deploying/cloud-sql-via-github-actions.md
index 9d34a9e3..358614f9 100644
--- a/doc/md/deployment/cloud-sql-via-github-actions.md
+++ b/doc/md/guides/deploying/cloud-sql-via-github-actions.md
@@ -1,7 +1,7 @@
 ---
 id: cloud-sql-via-github-actions
 slug: /guides/deploying/cloud-sql-via-github-actions
-title: Deploying Schema Migrations to Google Cloud SQL Using Atlas
+title: Deploying schema migrations to Google CloudSQL using Atlas
 ---
 
 ## In this article
diff --git a/doc/md/guides/guides.md b/doc/md/guides/guides.md
index 3e5612bc..a1b8c2dc 100644
--- a/doc/md/guides/guides.md
+++ b/doc/md/guides/guides.md
@@ -20,6 +20,8 @@ Welcome to the Atlas Guides.
 
 [Deploying schema migrations to Kubernetes with Init Containers](deploying/init.md)
 
+[Deploying to CloudSQL with GitHub Actions](deploying/cloud-sql-via-github-actions.md)
+
 [Using Atlas with Fly.io](/guides/deploying/fly-io)
 
 ## Databases
diff --git a/doc/website/sidebars.js b/doc/website/sidebars.js
index 936f7e2b..5a82fae9 100644
--- a/doc/website/sidebars.js
+++ b/doc/website/sidebars.js
@@ -130,6 +130,11 @@ module.exports = {
                     type: 'doc',
                     id: 'guides/deploying/fly-io',
                     label: 'Fly.io'
+                },
+                {
+                    type: 'doc',
+                    id: 'guides/deploying/cloud-sql-via-github-actions',
+                    label: 'GCP CloudSQL (GH Actions)'
                 }
             ]
         },
diff --git a/internal/integration/go.mod b/internal/integration/go.mod
index ec307e35..85c8836f 100644
--- a/internal/integration/go.mod
+++ b/internal/integration/go.mod
@@ -7,8 +7,8 @@ replace ariga.io/atlas => ../../
 replace ariga.io/atlas/cmd/atlas => ../../cmd/atlas
 
 require (
-	ariga.io/atlas v0.10.1-0.20230404183748-023b08ad359c
-	entgo.io/ent v0.12.1
+	ariga.io/atlas v0.10.2-0.20230427182402-87a07dfb83bf
+	entgo.io/ent v0.12.3
 	github.com/go-sql-driver/mysql v1.7.0
 	github.com/hashicorp/hcl/v2 v2.13.0
 	github.com/lib/pq v1.10.7
@@ -20,7 +20,7 @@ require (
 )
 
 require (
-	ariga.io/atlas/cmd/atlas v0.10.2-0.20230417081359-db8337c9b6ac // indirect
+	ariga.io/atlas/cmd/atlas v0.10.2-0.20230501073336-01cb833e7b72 // indirect
 	cloud.google.com/go v0.103.0 // indirect
 	cloud.google.com/go/compute v1.7.0 // indirect
 	cloud.google.com/go/iam v0.3.0 // indirect
@@ -95,13 +95,13 @@ require (
 	go.uber.org/zap v1.21.0 // indirect
 	gocloud.dev v0.27.0 // indirect
 	golang.org/x/exp v0.0.0-20220428152302-39d4317da171 // indirect
-	golang.org/x/mod v0.8.0 // indirect
-	golang.org/x/net v0.8.0 // indirect
+	golang.org/x/mod v0.10.0 // indirect
+	golang.org/x/net v0.9.0 // indirect
 	golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
 	golang.org/x/sync v0.1.0 // indirect
-	golang.org/x/sys v0.6.0 // indirect
-	golang.org/x/text v0.8.0 // indirect
-	golang.org/x/tools v0.6.1-0.20230222164832-25d2519c8696 // indirect
+	golang.org/x/sys v0.7.0 // indirect
+	golang.org/x/text v0.9.0 // indirect
+	golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901 // indirect
 	golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
 	google.golang.org/api v0.91.0 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
diff --git a/internal/integration/go.sum b/internal/integration/go.sum
index 52625bcd..07279628 100644
--- a/internal/integration/go.sum
+++ b/internal/integration/go.sum
@@ -84,6 +84,8 @@ entgo.io/ent v0.11.10-0.20230304080653-f16451eab831 h1:O9fyn2fQlDCSzXmDiCulR53VG
 entgo.io/ent v0.11.10-0.20230304080653-f16451eab831/go.mod h1:mzTZ0trE+jCQw/fnzijbm5Mck/l8Gbg7gC/+L1COyzM=
 entgo.io/ent v0.12.1 h1:bqK+WMwfjpTsFiXx9tQSEZMNLyAADSx5Y1xySjT4Tm8=
 entgo.io/ent v0.12.1/go.mod h1:OA1Y5bNE8EtlxKv4IyzWwt4jgvGbkoKMcwp668iEKQE=
+entgo.io/ent v0.12.3 h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk=
+entgo.io/ent v0.12.3/go.mod h1:AigGGx+tbrBBYHAzGOg8ND661E5cxx1Uiu5o/otJ6Yg=
 github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg=
 github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
 github.com/Azure/azure-amqp-common-go/v3 v3.2.3/go.mod h1:7rPmbSfszeovxGfc5fSAXE4ehlXQZHpMja2OtxC2Tas=
@@ -1668,6 +1670,8 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -1747,6 +1751,8 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug
 golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
 golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
 golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
+golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1932,6 +1938,8 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
 golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
+golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@@ -1948,6 +1956,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
 golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -2046,6 +2056,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E
 golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
 golang.org/x/tools v0.6.1-0.20230222164832-25d2519c8696 h1:8985/C5IvACpd9DDXckSnjSBLKDgbxXiyODgi94zOPM=
 golang.org/x/tools v0.6.1-0.20230222164832-25d2519c8696/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
+golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901 h1:0wxTF6pSjIIhNt7mo9GvjDfzyCOiWhmICgtO/Ah948s=
+golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
 golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/schemahcl/spec.go b/schemahcl/spec.go
index 472cfe4e..ba87124e 100644
--- a/schemahcl/spec.go
+++ b/schemahcl/spec.go
@@ -65,7 +65,7 @@ type (
 
 		// FromSpec is an optional function that can be attached
 		// to the type spec and allows converting the schema spec
-		// type to a schema type (from document to databse).
+		// type to a schema type (from document to database).
 		FromSpec func(*Type) (schema.Type, error)
 
 		// ToSpec is an optional function that can be attached
diff --git a/sql/internal/sqlx/diff.go b/sql/internal/sqlx/diff.go
index a2ca6227..8f9d6a36 100644
--- a/sql/internal/sqlx/diff.go
+++ b/sql/internal/sqlx/diff.go
@@ -76,16 +76,19 @@ type (
 
 // RealmDiff implements the schema.Differ for Realm objects and returns a list of changes
 // that need to be applied in order to move a database from the current state to the desired.
-func (d *Diff) RealmDiff(from, to *schema.Realm) ([]schema.Change, error) {
-	var changes []schema.Change
+func (d *Diff) RealmDiff(from, to *schema.Realm, options ...schema.DiffOption) ([]schema.Change, error) {
+	var (
+		changes schema.Changes
+		opts    = schema.NewDiffOptions(options...)
+	)
 	// Drop or modify schema.
 	for _, s1 := range from.Schemas {
 		s2, ok := to.Schema(s1.Name)
 		if !ok {
-			changes = append(changes, &schema.DropSchema{S: s1})
+			changes = opts.AddOrSkip(changes, &schema.DropSchema{S: s1})
 			continue
 		}
-		change, err := d.SchemaDiff(s1, s2)
+		change, err := d.schemaDiff(s1, s2, opts)
 		if err != nil {
 			return nil, err
 		}
@@ -96,9 +99,9 @@ func (d *Diff) RealmDiff(from, to *schema.Realm) ([]schema.Change, error) {
 		if _, ok := from.Schema(s1.Name); ok {
 			continue
 		}
-		changes = append(changes, &schema.AddSchema{S: s1})
+		changes = opts.AddOrSkip(changes, &schema.AddSchema{S: s1})
 		for _, t := range s1.Tables {
-			changes = append(changes, &schema.AddTable{T: t})
+			changes = opts.AddOrSkip(changes, &schema.AddTable{T: t})
 		}
 	}
 	return changes, nil
@@ -106,14 +109,18 @@ func (d *Diff) RealmDiff(from, to *schema.Realm) ([]schema.Change, error) {
 
 // SchemaDiff implements the schema.Differ interface and returns a list of
 // changes that need to be applied in order to move from one state to the other.
-func (d *Diff) SchemaDiff(from, to *schema.Schema) ([]schema.Change, error) {
+func (d *Diff) SchemaDiff(from, to *schema.Schema, opts ...schema.DiffOption) ([]schema.Change, error) {
+	return d.schemaDiff(from, to, schema.NewDiffOptions(opts...))
+}
+
+func (d *Diff) schemaDiff(from, to *schema.Schema, opts *schema.DiffOptions) ([]schema.Change, error) {
 	if from.Name != to.Name {
 		return nil, fmt.Errorf("mismatched schema names: %q != %q", from.Name, to.Name)
 	}
 	var changes []schema.Change
 	// Drop or modify attributes (collations, charset, etc).
 	if change := d.SchemaAttrDiff(from, to); len(change) > 0 {
-		changes = append(changes, &schema.ModifySchema{
+		changes = opts.AddOrSkip(changes, &schema.ModifySchema{
 			S:       to,
 			Changes: change,
 		})
@@ -123,16 +130,16 @@ func (d *Diff) SchemaDiff(from, to *schema.Schema) ([]schema.Change, error) {
 	for _, t1 := range from.Tables {
 		switch t2, err := d.findTable(to, t1.Name); {
 		case schema.IsNotExistError(err):
-			changes = append(changes, &schema.DropTable{T: t1})
+			changes = opts.AddOrSkip(changes, &schema.DropTable{T: t1})
 		case err != nil:
 			return nil, err
 		default:
-			change, err := d.tableDiff(t1, t2)
+			change, err := d.tableDiff(t1, t2, opts)
 			if err != nil {
 				return nil, err
 			}
 			if len(change) > 0 {
-				changes = append(changes, &schema.ModifyTable{
+				changes = opts.AddOrSkip(changes, &schema.ModifyTable{
 					T:       t2,
 					Changes: change,
 				})
@@ -143,7 +150,7 @@ func (d *Diff) SchemaDiff(from, to *schema.Schema) ([]schema.Change, error) {
 	for _, t1 := range to.Tables {
 		switch _, err := d.findTable(from, t1.Name); {
 		case schema.IsNotExistError(err):
-			changes = append(changes, &schema.AddTable{T: t1})
+			changes = opts.AddOrSkip(changes, &schema.AddTable{T: t1})
 		case err != nil:
 			return nil, err
 		}
@@ -153,15 +160,15 @@ func (d *Diff) SchemaDiff(from, to *schema.Schema) ([]schema.Change, error) {
 
 // TableDiff implements the schema.TableDiffer interface and returns a list of
 // changes that need to be applied in order to move from one state to the other.
-func (d *Diff) TableDiff(from, to *schema.Table) ([]schema.Change, error) {
+func (d *Diff) TableDiff(from, to *schema.Table, opts ...schema.DiffOption) ([]schema.Change, error) {
 	if from.Name != to.Name {
 		return nil, fmt.Errorf("mismatched table names: %q != %q", from.Name, to.Name)
 	}
-	return d.tableDiff(from, to)
+	return d.tableDiff(from, to, schema.NewDiffOptions(opts...))
 }
 
 // tableDiff implements the table diffing but skips the table name check.
-func (d *Diff) tableDiff(from, to *schema.Table) ([]schema.Change, error) {
+func (d *Diff) tableDiff(from, to *schema.Table, opts *schema.DiffOptions) ([]schema.Change, error) {
 	// tableDiff can be called with non-identical
 	// names without affecting the diff process.
 	if name := from.Name; name != to.Name {
@@ -186,7 +193,7 @@ func (d *Diff) tableDiff(from, to *schema.Table) ([]schema.Change, error) {
 	for _, c1 := range from.Columns {
 		c2, ok := to.Column(c1.Name)
 		if !ok {
-			changes = append(changes, &schema.DropColumn{C: c1})
+			changes = opts.AddOrSkip(changes, &schema.DropColumn{C: c1})
 			continue
 		}
 		change, err := d.ColumnChange(from, c1, c2)
@@ -194,7 +201,7 @@ func (d *Diff) tableDiff(from, to *schema.Table) ([]schema.Change, error) {
 			return nil, err
 		}
 		if change != schema.NoChange {
-			changes = append(changes, &schema.ModifyColumn{
+			changes = opts.AddOrSkip(changes, &schema.ModifyColumn{
 				From:   c1,
 				To:     c2,
 				Change: change,
@@ -204,23 +211,25 @@ func (d *Diff) tableDiff(from, to *schema.Table) ([]schema.Change, error) {
 	// Add columns.
 	for _, c1 := range to.Columns {
 		if _, ok := from.Column(c1.Name); !ok {
-			changes = append(changes, &schema.AddColumn{C: c1})
+			changes = opts.AddOrSkip(changes, &schema.AddColumn{
+				C: c1,
+			})
 		}
 	}
 
 	// Primary-key and index changes.
-	changes = append(changes, d.pkDiff(from, to)...)
-	changes = append(changes, d.indexDiff(from, to)...)
+	changes = append(changes, d.pkDiff(from, to, opts)...)
+	changes = append(changes, d.indexDiff(from, to, opts)...)
 
 	// Drop or modify foreign-keys.
 	for _, fk1 := range from.ForeignKeys {
 		fk2, ok := to.ForeignKey(fk1.Symbol)
 		if !ok {
-			changes = append(changes, &schema.DropForeignKey{F: fk1})
+			changes = opts.AddOrSkip(changes, &schema.DropForeignKey{F: fk1})
 			continue
 		}
 		if change := d.fkChange(fk1, fk2); change != schema.NoChange {
-			changes = append(changes, &schema.ModifyForeignKey{
+			changes = opts.AddOrSkip(changes, &schema.ModifyForeignKey{
 				From:   fk1,
 				To:     fk2,
 				Change: change,
@@ -230,7 +239,7 @@ func (d *Diff) tableDiff(from, to *schema.Table) ([]schema.Change, error) {
 	// Add foreign-keys.
 	for _, fk1 := range to.ForeignKeys {
 		if _, ok := from.ForeignKey(fk1.Symbol); !ok {
-			changes = append(changes, &schema.AddForeignKey{F: fk1})
+			changes = opts.AddOrSkip(changes, &schema.AddForeignKey{F: fk1})
 		}
 	}
 	return changes, nil
@@ -238,17 +247,17 @@ func (d *Diff) tableDiff(from, to *schema.Table) ([]schema.Change, error) {
 
 // pkDiff returns the schema changes (if any) for migrating table
 // primary-key from current state to the desired state.
-func (d *Diff) pkDiff(from, to *schema.Table) (changes []schema.Change) {
+func (d *Diff) pkDiff(from, to *schema.Table, opts *schema.DiffOptions) (changes []schema.Change) {
 	switch pk1, pk2 := from.PrimaryKey, to.PrimaryKey; {
 	case pk1 == nil && pk2 != nil:
-		changes = append(changes, &schema.AddPrimaryKey{P: pk2})
+		changes = opts.AddOrSkip(changes, &schema.AddPrimaryKey{P: pk2})
 	case pk1 != nil && pk2 == nil:
-		changes = append(changes, &schema.DropPrimaryKey{P: pk1})
+		changes = opts.AddOrSkip(changes, &schema.DropPrimaryKey{P: pk1})
 	case pk1 != nil && pk2 != nil:
 		change := d.indexChange(pk1, pk2)
 		change &= ^schema.ChangeUnique
 		if change != schema.NoChange {
-			changes = append(changes, &schema.ModifyPrimaryKey{
+			changes = opts.AddOrSkip(changes, &schema.ModifyPrimaryKey{
 				From:   pk1,
 				To:     pk2,
 				Change: change,
@@ -260,7 +269,7 @@ func (d *Diff) pkDiff(from, to *schema.Table) (changes []schema.Change) {
 
 // indexDiff returns the schema changes (if any) for migrating table
 // indexes from current state to the desired state.
-func (d *Diff) indexDiff(from, to *schema.Table) []schema.Change {
+func (d *Diff) indexDiff(from, to *schema.Table, opts *schema.DiffOptions) []schema.Change {
 	var (
 		changes []schema.Change
 		exists  = make(map[*schema.Index]bool)
@@ -271,7 +280,7 @@ func (d *Diff) indexDiff(from, to *schema.Table) []schema.Change {
 		// Found directly.
 		if ok {
 			if change := d.indexChange(idx1, idx2); change != schema.NoChange {
-				changes = append(changes, &schema.ModifyIndex{
+				changes = opts.AddOrSkip(changes, &schema.ModifyIndex{
 					From:   idx1,
 					To:     idx2,
 					Change: change,
@@ -288,7 +297,7 @@ func (d *Diff) indexDiff(from, to *schema.Table) []schema.Change {
 			}
 		}
 		// Not found.
-		changes = append(changes, &schema.DropIndex{I: idx1})
+		changes = opts.AddOrSkip(changes, &schema.DropIndex{I: idx1})
 	}
 	// Add indexes.
 	for _, idx := range to.Indexes {
@@ -296,7 +305,7 @@ func (d *Diff) indexDiff(from, to *schema.Table) []schema.Change {
 			continue
 		}
 		if _, ok := from.Index(idx.Name); !ok {
-			changes = append(changes, &schema.AddIndex{I: idx})
+			changes = opts.AddOrSkip(changes, &schema.AddIndex{I: idx})
 		}
 	}
 	return changes
diff --git a/sql/schema/migrate.go b/sql/schema/migrate.go
index 45958a0c..5132d558 100644
--- a/sql/schema/migrate.go
+++ b/sql/schema/migrate.go
@@ -7,6 +7,7 @@ package schema
 import (
 	"context"
 	"errors"
+	"reflect"
 	"time"
 )
 
@@ -264,23 +265,73 @@ func (k ChangeKind) Is(c ChangeKind) bool {
 	return k == c || k&c != 0
 }
 
-// Differ is the interface implemented by the different
-// drivers for comparing and diffing schema top elements.
-type Differ interface {
-	// RealmDiff returns a diff report for migrating a realm
-	// (or a database) from state "from" to state "to". An error
-	// is returned if such step is not possible.
-	RealmDiff(from, to *Realm) ([]Change, error)
-
-	// SchemaDiff returns a diff report for migrating a schema
-	// from state "from" to state "to". An error is returned
-	// if such step is not possible.
-	SchemaDiff(from, to *Schema) ([]Change, error)
-
-	// TableDiff returns a diff report for migrating a table
-	// from state "from" to state "to". An error is returned
-	// if such step is not possible.
-	TableDiff(from, to *Table) ([]Change, error)
+type (
+	// Differ is the interface implemented by the different
+	// drivers for comparing and diffing schema top elements.
+	Differ interface {
+		// RealmDiff returns a diff report for migrating a realm
+		// (or a database) from state "from" to state "to". An error
+		// is returned if such step is not possible.
+		RealmDiff(from, to *Realm, opts ...DiffOption) ([]Change, error)
+
+		// SchemaDiff returns a diff report for migrating a schema
+		// from state "from" to state "to". An error is returned
+		// if such step is not possible.
+		SchemaDiff(from, to *Schema, opts ...DiffOption) ([]Change, error)
+
+		// TableDiff returns a diff report for migrating a table
+		// from state "from" to state "to". An error is returned
+		// if such step is not possible.
+		TableDiff(from, to *Table, opts ...DiffOption) ([]Change, error)
+	}
+
+	// DiffOptions defines the standard and per-driver configuration
+	// for the schema diffing process.
+	DiffOptions struct {
+		// SkipChanges defines a list of change types to skip.
+		SkipChanges []Change
+	}
+
+	// DiffOption allows configuring the DiffOptions using functional options.
+	DiffOption func(*DiffOptions)
+)
+
+// NewDiffOptions creates a new DiffOptions from the given configuration.
+func NewDiffOptions(opts ...DiffOption) *DiffOptions {
+	o := &DiffOptions{}
+	for _, opt := range opts {
+		opt(o)
+	}
+	return o
+}
+
+// DiffSkipChanges returns a DiffOption that skips the given change types.
+// For example, in order to skip all destructive changes, use:
+//
+//	DiffSkipChanges(&DropSchema{}, &DropTable{}, &DropColumn{}, &DropIndex{}, &DropForeignKey{})
+func DiffSkipChanges(changes ...Change) DiffOption {
+	return func(o *DiffOptions) {
+		o.SkipChanges = append(o.SkipChanges, changes...)
+	}
+}
+
+// Skipped reports whether the given change should be skipped.
+func (o *DiffOptions) Skipped(c Change) bool {
+	for _, s := range o.SkipChanges {
+		if reflect.TypeOf(c) == reflect.TypeOf(s) {
+			return true
+		}
+	}
+	return false
+}
+
+// AddOrSkip adds the given change to the list of changes if it is not skipped.
+func (o *DiffOptions) AddOrSkip(changes Changes, c Change) Changes {
+	if !o.Skipped(c) {
+		return append(changes, c)
+	}
+	return changes
+
 }
 
 // ErrLocked is returned on Lock calls which have failed to obtain the lock.


Test patch:
diff --git a/cmd/atlas/internal/sqlparse/myparse/myparse_test.go b/cmd/atlas/internal/sqlparse/myparse/myparse_test.go
index cb865988..486c14d4 100644
--- a/cmd/atlas/internal/sqlparse/myparse/myparse_test.go
+++ b/cmd/atlas/internal/sqlparse/myparse/myparse_test.go
@@ -436,6 +436,6 @@ type mockDriver struct {
 	changes schema.Changes
 }
 
-func (d mockDriver) TableDiff(_, _ *schema.Table) ([]schema.Change, error) {
+func (d mockDriver) TableDiff(_, _ *schema.Table, _ ...schema.DiffOption) ([]schema.Change, error) {
 	return d.changes, nil
 }
diff --git a/sql/migrate/migrate_test.go b/sql/migrate/migrate_test.go
index 7bba7637..7fd3e556 100644
--- a/sql/migrate/migrate_test.go
+++ b/sql/migrate/migrate_test.go
@@ -573,11 +573,11 @@ func (m *mockDriver) InspectRealm(context.Context, *schema.InspectRealmOption) (
 	return &m.realm, nil
 }
 
-func (m *mockDriver) SchemaDiff(_, _ *schema.Schema) ([]schema.Change, error) {
+func (m *mockDriver) SchemaDiff(_, _ *schema.Schema, _ ...schema.DiffOption) ([]schema.Change, error) {
 	return m.changes, nil
 }
 
-func (m *mockDriver) RealmDiff(_, _ *schema.Realm) ([]schema.Change, error) {
+func (m *mockDriver) RealmDiff(_, _ *schema.Realm, _ ...schema.DiffOption) ([]schema.Change, error) {
 	return m.changes, nil
 }
 
diff --git a/sql/mysql/diff_test.go b/sql/mysql/diff_test.go
index 6c6d8b87..b98b6a0c 100644
--- a/sql/mysql/diff_test.go
+++ b/sql/mysql/diff_test.go
@@ -731,3 +731,78 @@ func TestDefaultDiff(t *testing.T) {
 	require.Len(t, changes, 1)
 	require.IsType(t, &schema.DropTable{}, changes[0])
 }
+
+func TestSkipChanges(t *testing.T) {
+	t.Run("DropSchema", func(t *testing.T) {
+		from, to := schema.NewRealm(schema.New("public")), schema.NewRealm()
+		changes, err := DefaultDiff.RealmDiff(from, to)
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+		changes, err = DefaultDiff.RealmDiff(from, to, schema.DiffSkipChanges(&schema.DropSchema{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+	})
+
+	t.Run("DropTable", func(t *testing.T) {
+		from, to := schema.NewRealm(schema.New("public").AddTables(schema.NewTable("users"))), schema.NewRealm(schema.New("public"))
+		changes, err := DefaultDiff.RealmDiff(from, to)
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+		changes, err = DefaultDiff.SchemaDiff(from.Schemas[0], to.Schemas[0])
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+
+		changes, err = DefaultDiff.RealmDiff(from, to, schema.DiffSkipChanges(&schema.DropTable{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+		changes, err = DefaultDiff.SchemaDiff(from.Schemas[0], to.Schemas[0], schema.DiffSkipChanges(&schema.DropTable{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+	})
+
+	t.Run("ModifyTable", func(t *testing.T) {
+		from := schema.NewRealm(
+			schema.New("public").AddTables(
+				schema.NewTable("users").
+					AddColumns(schema.NewIntColumn("id", "int")).
+					AddIndexes(schema.NewIndex("users_id_idx").AddColumns(schema.NewIntColumn("id", "int"))),
+			),
+		)
+		to := schema.NewRealm(schema.New("public").AddTables(schema.NewTable("users")))
+		changes, err := DefaultDiff.RealmDiff(from, to)
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+		require.Len(t, changes[0].(*schema.ModifyTable).Changes, 2)
+		changes, err = DefaultDiff.SchemaDiff(from.Schemas[0], to.Schemas[0])
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+		require.Len(t, changes[0].(*schema.ModifyTable).Changes, 2)
+
+		changes, err = DefaultDiff.RealmDiff(from, to, schema.DiffSkipChanges(&schema.ModifyTable{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+		changes, err = DefaultDiff.SchemaDiff(from.Schemas[0], to.Schemas[0], schema.DiffSkipChanges(&schema.ModifyTable{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+
+		changes, err = DefaultDiff.RealmDiff(from, to, schema.DiffSkipChanges(&schema.DropColumn{}, &schema.DropIndex{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+		changes, err = DefaultDiff.SchemaDiff(from.Schemas[0], to.Schemas[0], schema.DiffSkipChanges(&schema.DropColumn{}, &schema.DropIndex{}))
+		require.NoError(t, err)
+		require.Empty(t, changes)
+
+		// Ignore partial table changes.
+		changes, err = DefaultDiff.RealmDiff(from, to, schema.DiffSkipChanges(&schema.DropColumn{}))
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+		require.Len(t, changes[0].(*schema.ModifyTable).Changes, 1)
+		require.IsType(t, &schema.DropIndex{}, changes[0].(*schema.ModifyTable).Changes[0])
+		changes, err = DefaultDiff.SchemaDiff(from.Schemas[0], to.Schemas[0], schema.DiffSkipChanges(&schema.DropIndex{}))
+		require.NoError(t, err)
+		require.Len(t, changes, 1)
+		require.Len(t, changes[0].(*schema.ModifyTable).Changes, 1)
+		require.IsType(t, &schema.DropColumn{}, changes[0].(*schema.ModifyTable).Changes[0])
+
+	})
+}