only mysql8

atlas migrate lint --dir file://migrations1 --dev-url URL --latest=1 > got.txt
cmp got.txt empty.txt

atlas migrate lint --dir file://migrations2 --dev-url URL --latest=1 > got.txt
cmp got.txt empty.txt

# Expect the command to fail; exit code 1.
! atlas migrate lint --dir file://migrations3 --dev-url URL --latest=1 > got.txt
cmp got.txt expected3.txt

# Expect to log only the connected schema.
! atlas migrate lint --dir file://migrations3 --dev-url URL --log='{{println "current:"}}{{.Schema.Current}}{{println "desired:"}}{{.Schema.Desired}}' --latest=1 > got.txt
cmp got.txt schema3.txt

-- empty.txt --
-- migrations1/1.sql --
CREATE TABLE users (id int);
/* Rename column is not a destructive change. */
ALTER TABLE users RENAME COLUMN id TO oid;

-- migrations2/1.sql --
CREATE TABLE users (id int);

-- migrations2/2.sql --
-- atlas:nolint incompatible
/* Rename table mixed with rename column is not a destructive change. */
ALTER TABLE users RENAME TO user, RENAME COLUMN id TO oid;

-- migrations3/1.sql --
CREATE TABLE users (id int);

-- migrations3/2.sql --
/* Rename table mixed with rename column is not a destructive change. */
ALTER TABLE users RENAME TO user, RENAME COLUMN id TO oid;

-- migrations3/3.sql --
ALTER TABLE user ADD COLUMN id int, DROP COLUMN oid;

-- expected3.txt --
3.sql: destructive changes detected:

	L1: Dropping non-virtual column "oid"

-- schema3.txt --
current:
table "user" {
  schema = schema.script_cli_migrate_lint_destructive
  column "oid" {
    null = true
    type = int
  }
}
schema "script_cli_migrate_lint_destructive" {
  charset = "utf8mb4"
  collate = "utf8mb4_0900_ai_ci"
}
desired:
table "user" {
  schema = schema.script_cli_migrate_lint_destructive
  column "id" {
    null = true
    type = int
  }
}
schema "script_cli_migrate_lint_destructive" {
  charset = "utf8mb4"
  collate = "utf8mb4_0900_ai_ci"
}
