Skip to content

MilesWuCode/atlas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

https://github.com/ariga/atlas/releases
chmod +x ./main
sudo mv ./main /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas

# example 專案資料庫
# test 空資料庫用於比較

# 取得
atlas schema inspect -u "mysql:https://root:password@localhost:3306/example" > schema.hcl

# 更新
atlas schema apply \
  -u "mysql:https://root:password@localhost:3306/example" \
  -f schema.hcl

# 比較
atlas migrate diff create_users \
  --dir="file:https://migrations" \
  --to="file:https://schema.hcl" \
  --dev-url="mysql:https://root:password@:3306/test"

# 檢查SQL伺服器
atlas schema inspect -u "mysql:https://root:password@localhost:3306"

# 生成up/down
atlas migrate diff create_users \
  --dir="file:https://migrations?format=golang-migrate" \
  --to="file:https://schema.hcl" \
  --dev-url="mysql:https://root:password@:3306/test"

# 使用env方式:atlas.hcl
atlas schema apply --env local
atlas migrate diff --env local
atlas migrate validate --env local

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages