! atlas schema apply -f empty/ -u URL --auto-approve
stderr '"empty" contains neither SQL nor HCL files'

atlas schema apply -f schema/ -u URL --auto-approve
cmpshow users expected.sql

atlas schema apply -f schema/ -u URL --auto-approve --dry-run --exclude "*.id" > inspected.txt
cmp inspected.txt alter.txt

atlas schema apply -f schema/ -u URL --auto-approve --dry-run --exclude "users" > inspected.txt
cmp inspected.txt create.txt

-- schema/users.hcl --
table "users" {
  schema = schema.main
  column "id" {
    null = false
    type = int
  }
  column "status" {
    null = true
    type = text
    default = "hello"
  }
}
-- schema/schema.hcl --
schema "main" {
}
-- empty/hello.txt --
hello, world!
-- expected.sql --
CREATE TABLE `users` (
  `id` int NOT NULL,
  `status` text NULL DEFAULT 'hello'
)
-- alter.txt --
-- Planned Changes:
-- Add column "id" to table: "users"
ALTER TABLE `users` ADD COLUMN `id` int NOT NULL;
-- create.txt --
-- Planned Changes:
-- Create "users" table
CREATE TABLE `users` (
  `id` int NOT NULL,
  `status` text NULL DEFAULT 'hello'
);
