Skip to content

v0.1.0

Compare
Choose a tag to compare
@yonidavidson yonidavidson released this 25 Nov 16:53
· 2338 commits to master since this release
d2ef939

Our first release of Atlas 🎊

This release contains the Atlas CLI with the following commands:

atlas schema inspect -d "mysql://root:pass@tcp(localhost:3306)/example" > atlas.hcl

Currently, Atlas supports only HCL syntax

# cat atlas.hcl
table "users" {
  schema = "example"
  column "id" {
    null = false
    type = "int"
  }
  column "name" {
    null = false
    type = "string"
    size = 255
  }
  column "manager_id" {
    null = false
    type = "int"
  }
  primary_key {
    columns = [table.users.column.id, ]
  }
  foreign_key "manager_fk" {
    columns     = [table.users.column.manager_id, ]
    ref_columns = [table.users.column.id, ]
    on_update   = "NO ACTION"
    on_delete   = "CASCADE"
  }
  index "idx_name" {
    unique  = true
    columns = [table.users.column.name, ]
  }
  index "manager_fk" {
    unique  = false
    columns = [table.users.column.manager_id, ]
  }
}
schema "example" {
}

For applying a schema to a database.

atlas schema apply -d "mysql://root:pass@tcp(localhost:3306)/example" -f atlas.hcl

Supported Databases:

  • MySQL.
  • PostgresSQL